6月30號(hào)的那個(gè)底航欄有些丑,今天用bootstrap框架給他美化了一些
studentlist.jsp
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="test.*" %>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
<script type="text/javascript">
function topage(currentpage) {
var form = document.forms[0];
form.currentpage.value = currentpage;
form.submit();
}
</script>
</head>
<body>
<form>
<input type="hidden" name="currentpage" />
<table align="center" style="width: 60%;" class="table table-hover"">
<thead>
<tr>
<th>學(xué)生編號(hào)</th>
<th>學(xué)生姓名</th>
<th>學(xué)生年齡</th>
<th>學(xué)生性別</th>
<th>學(xué)生生日</th>
</tr>
</thead>
<c:forEach items="${requestScope.list}" var="list">
<tbody>
<tr>
<td>${list.id }</td>
<td>${list.name }</td>
<td>${list.age }</td>
<td>${list.sex }</td>
<td>${list.birth}</td>
</tr>
</tbody>
</c:forEach>
</table>
<div align="center" >
<nav>
<ul class="pagination"><!-- 前端框架控制導(dǎo)航條 -->
<c:forEach begin="${pageView.startindex}" end="${pageView.endindex}" var="wp">
<c:if test="${pageView.currentpage==wp}">
<li class="active"><a>${wp}</a></li><!-- 前端框架控制導(dǎo)航條 -->
</c:if>
<c:if test="${pageView.currentpage!=wp}">
<li><a href="javascript:topage('${wp}')">${wp}</a></li><!-- 前端框架控制導(dǎo)航條 -->
</c:if>
</c:forEach>
<!-- ${pageView.totalrecordnumber} 本來他寫錯(cuò)了 -->
<li><a>總共${pageView.totalpagenumber}頁</a></li><!-- 前端框架控制導(dǎo)航條 -->
</ul>
</nav>
</div>
</form>
</body>
</html>
顯示效果:
1.png
結(jié)束!