thinkphp分页样式
html代码:
<div class="pages">{$page}</div>
css代码:
.pages{ width:100.5%; text-align:right; padding: 10px 0; clear:both; } .pages a,.pages .current{ font-size: 12px; font-family: Arial; margin: 0 2px; border: 1px solid #D1D1D1; background: #fff; padding: 2px 6px; text-decoration: none; } .pages .current,.pages a:hover{ background:#35B9B2; color:#fff; }
php控制器代码:
$Page = new Page($count,20);// 实例化分页类 传入总记录数和每页显示的记录数 $Page -> setConfig('header','共%TOTAL_ROW%条'); $Page -> setConfig('first','首页'); $Page -> setConfig('last','共%TOTAL_PAGE%页'); $Page -> setConfig('prev','上一页'); $Page -> setConfig('next','下一页'); $Page -> setConfig('link','indexpagenumb');//pagenumb 会替换成页码 $Page -> setConfig('theme','%HEADER% %FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END%'); $this -> page = $Page->show();