📄 findall.jsp
字号:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:if test="${requestScope.users == null}">
<jsp:forward page="./FindAllAction.action">
<jsp:param name="method" value="query" />
</jsp:forward>
</c:if>
<html>
<head>
<title>表格隔行换色</title>
<style type="text/css" media="screen">
<!-- /* PR-CSS */
.mytable {
border-collapse: collapse;
border: solid #2E64A0;
border-width: 1px 0 0 1px;
}
.mytable td {
border: solid #2E64A0;
border-width: 0 1px 1px 0;
font-family: "Verdana,宋体";
font-size: 12px;
color: #000;
text-align: center;
padding: 5px;
}
.t1 {
background-color: #EDF2F7;
} /* 第一行的背景色 */
.t2 {
background-color: #ffffff;
} /* 第二行的背景色 */
.t3 {
background-color: #E0E5F0;
} /* 鼠标经过时的背景色 */
body {
text-align: center;
}
#box {
margin: 100px
}
-->
</style>
</head>
<body background="images/5.jpg">
<table width="1600" cellspacing="1" bgcolor="#336699" class=mytable
id="tab">
<tr bgcolor="#CCCCCC" align="center">
<td width="100" height="30">
用户名
</td>
<td width="100">
密码
</td>
<td width="100">
性别
</td>
<td width="100">
出生年月
</td>
<td width="100">
电子邮件
</td>
<td width="100">
电话号码
</td>
<td width="100">
身份证号
</td>
<td width="200">
密码保护问题1
</td>
<td width="200">
密码保护回答1
</td>
<td width="200">
密码保护问题2
</td>
<td width="200">
密码保护回答2
</td>
<td width="100">
权限等级
</td>
</tr>
<c:forEach items="${requestScope.users}" var="user">
<tr bgcolor="#FFFFFF" align="center">
<td height="30">
${user.username}
</td>
<td>
${user.password}
</td>
<td>
${user.sex}
</td>
<td>
${user.birthday}
</td>
<td>
${user.email}
</td>
<td>
${user.telephone}
</td>
<td>
${user.card}
</td>
<td>
${user.questionone}
</td>
<td>
${user.answerone}
</td>
<td>
${user.questiontwo}
</td>
<td>
${user.answertwo}
</td>
<td>
${user.popedom_id}
</td>
</tr>
</c:forEach>
</table>
</body>
<script type="text/javascript">
<!--
var Ptr=document.getElementById("tab").getElementsByTagName("tr");
function $() {
for (i=1;i<Ptr.length+1;i++) {
Ptr[i-1].className = (i%2>0)?"t1":"t2";
var TRsel = Ptr[i-1].getElementsByTagName("select");
for(var k=0; k<TRsel.length;k++){
TRsel[k].className = Ptr[i-1].className;
}
}
}
window.onload=$;
for(var i=0;i<Ptr.length;i++) {
Ptr[i].onmouseover=function(){
this.tmpClass=this.className;
this.className = "t3";
var TRsel = this.getElementsByTagName("select");
for(var k=0; k<TRsel.length;k++){
TRsel[k].className = this.className;
}
};
Ptr[i].onmouseout=function(){
this.className=this.tmpClass;
var TRsel = this.getElementsByTagName("select");
for(var k=0; k<TRsel.length;k++){
TRsel[k].className = this.className;
}
};
}
//-->
</script>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -