1
我在我的项目中使用了JQUERY DATATABLES。我已经添加了所有参考资料,并遵循了文档中指定的所有步骤。但我无法看到分页。我可以看到表格排序,但我可以看到分页数。我觉得它选错了jquery库。我怎么知道它指的是哪个jQuery?在jQuery数据表中没有显示分页
我下面引用我的项目的数据表。
<script src="~/Scripts/jquery.js"></script>
<script src="~/Scripts/jquery.dataTables.js"></script>
<link href="~/Content/jquery.dataTables.css" rel="stylesheet" />
我有如下表数据
<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
</tr>
<tr>
<td>Garrett Winters</td>
<td>Accountant</td>
<td>Tokyo</td>
</tr>
<tr>
<td>Ashton Cox</td>
<td>Junior Technical Author</td>
<td>San Francisco</td>
</tr>
<tr>
<td>Cedric Kelly</td>
<td>Senior Javascript Developer</td>
<td>Edinburgh</td>
</tr>
<tr>
<td>Airi Satou</td>
<td>Accountant</td>
<td>Tokyo</td>
</tr>
</tbody>
</table>
我这里渲染数据表
<script type="text/javascript">
$(function() {
var localTable =$('#example').dataTable({
"bProcessing": true,
"iDisplayLength": 5,
"bPaginate": true,
"sPaginationType": "full_numbers"
});
});
</script>
检查语法这里HTTP://www.datatables .NET /为例es/basic_init/alt_pagination.html – Athiruban
你试过看这个吗? http://stackoverflow.com/questions/25200305/jquery-datatable-pagination-not-appearing –
你正在使用哪个jQuery版本? – chridam