0
我正在使用datatables插件,但分页不起作用。我已经实例化CSS和JS要求,但我不知道为什么这不起作用。jquery datatables不能与分页
一切正常,只是分页按钮没有,有什么建议吗?
HEAD:
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.12/css/dataTables.bootstrap.min.css"></style>
<link rel="stylesheet" type="text/css" href="/css/bootstrap.vertical-tabs.min.css"></style>
FOOTER:
<script type="text/javascript" src="http://cdn.datatables.net/1.10.2/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="/action/controller.js"></script><!-- this my js -->
HTML:
<table id="datagrid_test" class="datagrid">
<thead>
<tr>
<th>FIELD1</th>
<th>FIELD2</th>
<th>FIELD3</th>
</tr>
</thead>
<?php
for ($i=0; $i < 20 ; $i++) { ?>
<tr>
<td>aaa<?=$i?></td>
<td>bbb<?=$i?></td>
<td>ccc<?=$i?></td>
</tr>
<?php } ?>
</tr>
</table>
JS:
$(document).ready(function(){
$('#datagrid_test').dataTable();
}
谢谢@ConstantineUA。这是工作正常! –