Home > php教程 > php手册 > 自己美化的分页代码分享

自己美化的分页代码分享

WBOY
Release: 2016-06-07 11:36:44
Original
979 people have browsed it

自己美化的分页代码分享
自己美化的分页代码分享
先看看效果

代码部分://设置分页查询<br> <br>     $Data = M('think.Huodong_fenlei'); // 实例化Data数据对象<br>     import('ORG.Util.Page');// 导入分页类<br>     $count      = $Data->where($map)->count();// 查询满足要求的总记录数<br>     $Page       = new Page($count,1);// 实例化分页类 传入总记录数并且每页显示5条记录<br>     $nowPage = isset($_GET['p'])?$_GET['p']:1;<br>     $list = $Data->where($map)->order('addtime desc')->page($nowPage.','.$Page->listRows)->select();<br>     $show       = $Page->show();// 分页显示输出<br>     $this->assign('page',$show);// 赋值分页输出<br>     $this->assign('list',$list);// 赋值数据集    <br>     $this->display();CSS部分.result.page {<br>     height: 40px;<br>     width: auto;<br>     text-align: center;<br>     line-height: 40px;<br>     padding-right: 30px;<br>     padding-left: 30px;<br>     margin: 15px auto 30px;<br> <br> }<br> <br> .result.page a {<br>     height: 25px;<br>     width: auto;<br>     display: inline-block;<br>     color: #333;<br>     border: 1px solid #CCC;<br>     text-decoration: none;<br>     line-height: 25px;<br>     padding-left: 5px;<br>     padding-right: 5px;<br>     background-color: #F9F9F9;<br> }<br> .result.page .current {<br>     height: 25px;<br>     width: auto;<br>     padding-left: 8px;<br>     padding-right: 8px;<br>     line-height: 25px;<br>     display: inline-block;<br>     background-color: #09F;<br>     color: #FFF;<br> }<br> .result.page a:hover {<br>     background-color: #09F;<br>     color:#FFF;<br>         border: 1px solid #09F;<br> }

附件 page.zip ( 8.4 KB 下载:118 次 )

AD:真正免费,域名+虚机+企业邮箱=0元

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template