網上找了很多文章,都沒有統一的寫完前後端Bootstrap+DataTables到底是怎麼運行好的,因此在折騰了好久後,把運行好的貼出來以作備份參考.
首先貼前臺的table
<table id="example1" class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>#</th>
<th>工號</th>
<th>姓名</th>
<th>性別</th>
<th>年齡</th>
<th>身份證號</th>
<th>聯繫電話</th>
<th>QQ號</th>
<th>電子郵箱</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot>
<!-- 這裏可以配置上table底部最後一行,要配成和thead的列一樣,不需要刻意不寫
<tr>
<th>Rendering engine</th>
<th>Browser</th>
<th>Platform(s)</th>
<th>Engine version</th>
<th>CSS grade</th>
</tr> -->
</tfoot>
</table>
接下來就是js寫法了
var draw =