【发布时间】:2016-05-07 14:43:33
【问题描述】:
目前我设置了下表:
<table id="add_users_table" class="table table-striped table-hover table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th><input type="checkbox" id="add_users_checkbox_all" value=""></th>
<th>ID</th>
<th>Email</th>
<th>Name</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
$('#add_users_table').dataTable({
"order": [],
"columnDefs": [
{"targets": [0,1], "width": "10%"},
{"targets": [2,3], "width": "40%"},
{"targets": 0, "orderable": false},
{className: "text-center", "targets": [0, 1]}
],
"language": {
"zeroRecords": "<i>No new users are available to add</i>"
},
"ajax": "/datatable/group/add_users/" + group_id
});
这给了我正确的信息,但在第一列中被压扁了:
有什么方法可以应用此消息以适应所有列?
编辑:我的 ajax 结果是一个空数据行 {"data":[]},这会有所不同吗?
【问题讨论】:
-
它正在工作jsfiddle.net/cmedina/7kfmyw6x/44你有额外的代码??
-
奇怪,我的ajax结果是一个空数据行
{"data":[]},这会有所不同吗?
标签: jquery datatables