【发布时间】:2017-02-06 13:55:26
【问题描述】:
下面是我的示例代码,但它不起作用。有人可以帮助我如何使用这个 jquery 数据表插件吗? 这个数据表插件可以用在sql结果字段表上吗?谢谢
<html>
<head>
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css">
</head>
<body>
<table id="example" style="border:1px solid black;">
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>etc</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1 Data 1</td>
<td>Row 1 Data 2</td>
<td>etc</td>
</tr>
<tr>
<td>Row 2 Data 1</td>
<td>Row 2 Data 2</td>
<td>etc</td>
</tr>
<tr>
<td>Row 2 Data 1</td>
<td>Row 2 Data 2</td>
<td>etc</td>
</tr>
</tbody>
</table>
</body>
<script type="text/javascript">
$(document).ready(function () {
$('#example').dataTable();
});
</script>
</html>
【问题讨论】:
-
它不应该做什么?
-
它只显示基本的 html yable,而不是数据表
标签: javascript jquery html datatables