贴个网址:http://www.layui.com/laypage/
html:
//此处为table
<table id="recordTable" style="width: 100%"></table>
//那这里就是分页咯
<div id="page" class="text-right"></div>
//你存放js的地址
<script src="/js/lib/laypage.js" type="text/javascript"></script>
js:
laypage({
cont: $('#page'),
pages: extra.pnCount, //总页数
skip: true,
curr: extra.pn, //当前页码
pageSize: extra.ps, //每页条数
skin: '#46b8da', //设置皮肤
jump: function(obj, first) {
if (!first) {
demo(obj.curr); //传递当前页
}
}
});