当我们使用jquery的datatable插件的时候,jquery会自动生成表格,并且为表格的行和列设置class属性。先看怎么用jquery来生成表格。在html页面的div标签中添加代码如下,其中 thead标签和tbody标签是必须的,thead里的tr可以没有。
<table id="user-table"
class="table table-border table-bordered table-bg table-sort">
<thead>
<tr>
<th scope="col" colspan="9">用户列表</th>
</tr>
<tr class="text-c">
<th width="25"><input type="checkbox" name="" value=""></th>
<th width="100">登录名</th>
<th width="50">性别</th>
<th width="90">电话</th>
<th width="150">邮箱</th>
<th width="200">创建时间</th>
<th width