form表單的樣式在哪個(gè)位置被覆蓋了?
jsp 部分代碼:
<%@ page language="java" contentType="text/html; charset=UTF-8"
? ? pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>學(xué)生信息</title>
</head>
<%
// 獲取請(qǐng)求的上下文
String context = request.getContextPath();
%>
<script type="text/javascript" src="../js/jquery-1.11.3.js"></script>
<link href="../css/pagination.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../js/jquery.pagination.js"></script>
<script type="text/javascript">
// 點(diǎn)擊分頁按鈕以后觸發(fā)的動(dòng)作
function handlePaginationClick(new_page_index, pagination_container) {
? ? $("#stuForm").attr("action", "<%=context %>/servlet/JdbcSqlServlet?pageNum=" + (new_page_index+1));
? ? $("#stuForm").submit();
? ? return false;
}
$(function(){
$("#News-Pagination").pagination('${result.totalRecord}', {
? ? ? ? items_per_page:'${result.pageSize}', // 每頁顯示多少條記錄
? ? ? ? current_page:'${result.currentPage}' - 1, // 當(dāng)前顯示第幾頁數(shù)據(jù)
? ? ? ? num_display_entries:8, // 分頁顯示的條目數(shù)
? ? ? ? next_text:"下一頁",
? ? ? ? prev_text:"上一頁",
? ? ? ? num_edge_entries:2, // 連接分頁主體,顯示的條目數(shù)
? ? ? ? callback:handlePaginationClick
});
// 設(shè)置學(xué)生默認(rèn)性別
$("#gender").val("${gender}");
});
</script>
<body>
<div style="margin-left: 100px; margin-top: 100px;">
<div>
<font color="red">${errorMsg }</font>
</div>
<div>
<form action="<%=context %>/servlet/JdbcSqlServlet"? ?id="stuForm"? method="post" >
姓名
<input type="text" name="stuName" id="stu_name" style="width:120px" value="${stuName }">
性別
<select name="gender" id="gender" style="width:80px">
<option value="0">全部</option>
<option value="1">男</option>
<option value="2">女</option>
</select>
<input type="submit" value="查詢">
</form>
</div>
<br>
學(xué)生信息列表:<br>
<br>
<!-- 后臺(tái)返回結(jié)果為空 -->
<c:if test="${fn:length(result.datalist) eq 0 }">
<span>查詢的結(jié)果不存在</span>
</c:if>
<!-- 后臺(tái)返回結(jié)果不為空 -->
<c:if test="${fn:length(result.datalist) gt 0 }">
<table border="1px" cellspacing="0px"
style="border-collapse: collapse">
<thead>
<tr height="30">
<th width="130">姓名</th>
<th width="130">性別</th>
<th width="130">年齡</th>
<th width="190">家庭地址</th>
</tr>
</thead>
<c:forEach items="${result.datalist }" var="student">
<tr>
<td><c:out value="${student.stuName }"></c:out></td>
<td>
<c:if test="${ student.gender eq 1}">男</c:if>
<c:if test="${ student.gender eq 2}">女</c:if>
</td>
<td><c:out value="${student.age }"></c:out></td>
<td><c:out value="${student.address }"></c:out></td>
</tr>
</c:forEach>
</table>
<br>?
<div id="News-Pagination"></div>
</c:if>
</div>
</body>
</html>
最后發(fā)現(xiàn)是css 的問題,
<link href="../css/pagination.css" rel="stylesheet" type="text/css"/>
2018-03-18
為什么我的顯示只有一條數(shù)據(jù)