分页算法

方法一

//总页数=(总记录数+每页行数-1)/每页行数
intPageCount = (intRowCount+intPageSize-1) / intPageSize;

 

方法二

//总记录数与每页显示记录数求余运算,计算总页数

setTotalpage(this.totalrecord % this.maxresult == 0 ? this.totalrecord / this.maxresult : this.totalrecord / this.maxresult + 1);

posted @ 2019-03-29 11:34  tc310  阅读(233)  评论(0)    收藏  举报