本文使用Bootstrap-table来对表格进行分页,关于Bootstrap-table以及下载插件包请点击官网:http://bootstrap-table.wenzhixin.net.cn

首先,需要引用脚本:bootstrap-table.jsbootstrap-table.min.js,以及bootstrap-table-zh-CN.js

HTML页面内容如下:

<table data-toggle="table" data-url="/Home/GetPaginationData2" data-height="465" 
       data-side-pagination="server" data-pagination="true" data-page-list="[5,10,20,50]">
    <thead>
        <tr>
            <th data-field="BusNo" data-align="center">乘车码</th>
            <th data-field="OrderId" data-align="center">订单号</th>
            <th data-field="OrderDate" data-align="center" data-formatter="FormatDateTime">订单日期</th>
        </tr>
    </thead>
</table>
View Code

相关文章: