JSTL标签显示分页的代码实例教程
程序员文章站
2022-04-15 21:22:44
jstl显示分页
页面表格的分页显示,通过jstl标签实现
页面效果
代码如下
// 分页显示
jstl显示分页
页面表格的分页显示,通过jstl标签实现
页面效果
代码如下
// 分页显示 <p class="table-pagination tablepagestyle <c:if test='${simple ne false}'> row-fluid tool ui-toolbar</c:if>"> <p class="pagination tablepagecontentstyle"> <ul> <c:choose> <c:when test="${page.firstpage}"> <li class="disabled"> <a class="apagestyle" title="第一页" onclick="$.table.skippage('${page.totalcount}','${pagesize}', 1, this);"> <p class="imgpagedivstyle"> <img src="${ctx}/static/pageicon/start-page.png" class="imagepagestyle"> </p> </a> </li> <li class="disabled"> <a class="apagestyle" title="上一页" onclick="$.table.skippage('${page.totalcount}','${pagesize}', ${current - 1}, this);"> <p class="imgpagedivstyle"> <img src="${ctx}/static/pageicon/up-page.png" class="imagepagestyle"> </p> </a> </li> </c:when> <c:otherwise> <li> <a class="apagestyle" title="第一页" onclick="$.table.skippage('${page.totalcount}','${pagesize}', 1, this);"> <p class="imgpagedivstyle"> <img src="${ctx}/static/pageicon/start-page.png" class="imagepagestyle"> </p> </a> </li> <li> <a class="apagestyle" title="上一页" onclick="$.table.skippage('${page.totalcount}','${pagesize}', ${current - 1}, this);"> <p class="imgpagedivstyle"> <img src="${ctx}/static/pageicon/up-page.png" class="imagepagestyle"> </p> </a> </li> </c:otherwise> </c:choose> <p class="digongdivstyle"> <span class="page-input dispanstyle"> 第 <input type="text" class="input-mini inputpagestyle" value="${current}" onblur="$.table.skippage('${page.totalcount}','${pagesize}', $(this).val(), this);"/> 页, </span> <span class="page-info gongspanstyle">共 ${page.totalpages} 页</span> </p> <c:choose> <c:when test="${page.lastpage}"> <li class="disabled"> <a class="apagestyle" title="下一页" onclick="$.table.skippage('${page.totalcount}','${pagesize}', ${current + 1}, this);"> <p class="imgpagedivstyle"> <img src="${ctx}/static/pageicon/down-page.png" class="imagepagestyle"> </p> </a> </li> <li class="disabled"> <a class="apagestyle" title="最后页" onclick="$.table.skippage('${page.totalcount}','${pagesize}', ${page.totalpages}, this);"> <p class="imgpagedivstyle"> <img src="${ctx}/static/pageicon/end-page.png" class="imagepagestyle"> </p> </a> </li> <li class="disabled"> <a class="apagestyle" title="刷新" onclick="$.table.skippage('${page.totalcount}','${pagesize}', ${current}, this);"> <p class="imgpagedivstyle refresh-page-button"> <img src="${ctx}/static/pageicon/refresh-page.png" class="imagepagestyle refresh-page-button-img"> </p> </a> </li> </c:when> <c:otherwise> <li> <a class="apagestyle" title="下一页" onclick="$.table.skippage('${page.totalcount}','${pagesize}', ${current + 1}, this);"> <p class="imgpagedivstyle"> <img src="${ctx}/static/pageicon/down-page.png" class="imagepagestyle"> </p> </a> </li> <li> <a class="apagestyle" title="最后页" onclick="$.table.skippage('${page.totalcount}','${pagesize}', ${page.totalpages}, this);"> <p class="imgpagedivstyle"> <img src="${ctx}/static/pageicon/down-page.png" class="imagepagestyle"> </p> </a> </li> <li > <a class="apagestyle" title="刷新" onclick="$.table.skippage('${page.totalcount}','${pagesize}', ${current}, this);"> <p class="imgpagedivstyle refresh-page-button"> <img src="${ctx}/static/pageicon/refresh-page.png" class="imagepagestyle refresh-page-button-img"> </p> </a> </li> </c:otherwise> </c:choose> </ul> <p class="xiangongdivstyle"> <c:choose> <c:when test="${current==1}"> <c:choose> <c:when test="${page.totalcount==0}"> <span class="page-info xianshispanstyle">显示 ${page.totalcount} 条,</span> </c:when> <c:otherwise> <c:if test="${page.totalcount<page.pagesize}"> <span class="page-info xianshispanstyle">显示 1 - ${page.totalcount} 条,</span> </c:if> <c:if test="${page.totalcount>page.pagesize}"> <span class="page-info xianshispanstyle">显示 1 - ${page.pagesize} 条,</span> </c:if> </c:otherwise> </c:choose> </c:when> <c:otherwise> <c:if test="${(page.totalcount - page.pagesize * (current - 1)) >= page.pagesize}"> <span class="page-info xianshispanstyle">显示 ${page.pagesize*(current-1)+1} - ${page.pagesize*current} 条,</span> </c:if> <c:if test="${(page.totalcount - page.pagesize * (current - 1)) < page.pagesize}"> <span class="page-info xianshispanstyle">显示 ${page.pagesize*(current-1)+1} - ${page.totalcount} 条,</span> </c:if> </c:otherwise> </c:choose> <span class="page-info xiangongspanstyle">共 ${page.totalcount} 条</span> </p> </p> </p>
上一篇: 干货福利:如何使用Python中Django模板?
下一篇: Expression拼接