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