我使用jQuery创建了一个数据表。以下是相同的HTML代码:
<table id="md-transaction-table" class="wide100 margin-bottom-1">
<thead>
<tr>
<th>Payment Date</th>
<th>Description</th>
<th>Statement Number</th>
<th>Payment Transaction ID</th>
<th>Amount</th>
<th>Payment Method</th>
<th>User</th>
<th>Payment Status</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
以下是相同的jQuery代码:
$('#md-transaction-table').dataTable({
"data":json,
"dom": 't',
"bSort":false,
"pageLength": 8,
"paging": true,
"bPaginate":true,
"pagingType":"full_numbers",
"columns": [
{"data": "paymentDate"},
{"data": "description"},
{"data": "statementNumber"},
{"data": "transactionId"},
{"data": "amount"},
{"data": "paymentMethod"},
{"data": "user"},
{"data": "paymentStatus"}
],
"columnDefs": [
{className: "pad-md-left-p-10 pad-top-bottom-p-10", "targets": [0,1,2,3,4,5,6,7]}
]
}); // End of datatable function
现在我需要在表格下方添加一个分页。像这样:
我的要求是,最初我需要在表格中只显示8行。当用户单击下一个按钮时,它必须隐藏前8行并显示下8行。你能告诉我我们怎么办?我正在使用datatable的默认分页功能。但是分页没有出现。你能告诉我我做错了吗?