javascript - dataTable分页没有出现

时间:2013-10-09 07:41:45

标签: javascript jquery pagination datatables

我在某些dataTable上设置了dataTable,但没有出现分页。你能帮我一把,纠正我吗?我做错了什么?

  $(".support-table").dataTable({
"aaSorting": [[ 1, "asc" ]],
"sDom": '<"support-table-header">',
"bDestroy" : true,
"bAutoWidth" : true,
"sScrollY" : "300",
"sScrollX" : "100%",
"bScrollCollapse" : true,
"bSort" : true,
"sPaginationType" : "full_numbers",
"iDisplayLength" : 3,
"bLengthChange" : false

})

1 个答案:

答案 0 :(得分:3)

删除

sDom": '<"support-table-header"> 

并且(重新)出现分页。

请参阅此小提琴http://jsfiddle.net/9aMDq/

sDom用于样式化数据表,例如设置元素(或“控件”)的顺序。以下是jQuery DataTables自己的发明者的解释:http://datatables.net/forums/discussion/37/the-sdom-parameter/p1 - sDom手册 - &gt; http://datatables.net/ref#sDom