开发者社区 问答 正文

jquery问题求大神指点

screenshot
这个题是怎么做的???

展开
收起
吴孟桥 2016-06-02 18:28:26 2038 分享 版权
1 条回答
写回答
取消 提交回答
  • jquery版本如下:

    var people=[{"name":"1111","email":"eeeee","phone":"112323423"},{"name":"2222","email":"33ddddd","phone":"4444444"}];
    var thead=$("<thead></thead>");
    var tbody=$("<tbody></tbody>");
    var table=$("<table></table>");
    thead.append("<tr><th>Name</th><th>Email</th><th>Phone</th></tr>");
    people.forEach(function(item){
    tbody.append("
    "+item.name+""+item.email+""+item.phone+"");
    });
    table.append(thead).append(tbody);
    table.css({"border-collapse":"collapse"}).find("td,th").css({border:"1px solid"});
    $("body").append(table);
    2019-07-17 19:25:29
    赞同 展开评论
问答分类:
问答地址: