目前我已设置以下表格:
<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":[]}
,这可能有所作为吗?