我想隔行换色显示从数据库中调用出来的文字背景。
我想隔行换色显示从数据库中调用出来的文字背景。请问要在怎么改,谢谢。<%@page contentType="text/html;charset=gb2312"import="java.sql.*"%>
<html>
<head>
<title>增加数据</title>
<style type="text/css">
</style>
</head>
<body style="background-color:#996">
<center>出库信息一览表
<br><br>
<form name="form1"method="post"action="c3_2.jsp">
<input type="submit"name="Submit"value="增加数据"class="style1"/>
<br>
</center>
<hr/><center>
<table border=1 width=100%>
<tr class="style2"bgcolor="#666668"align="center">
<td>货物编号</td>
<td>货物名称</td>
<td>货物规格</td>
<td>货物单位</td>
<td>货物数量</td>
<td>货物价格</td>
<td>货物产地</td>
<td>客户编号</td>
<td>客户名称</td>
<td>客户地址</td>
<td>客户电话</td>
<td>出库时间</td>
</tr></center>
<%
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
//.newinstance();
String url = "jdbc:sqlserver://localhost:1433;databasename=CANGCHU";
String user = "sa";
String password = "12345";
Connection con = DriverManager.getConnection(url, user, password);
Statement stmt = con.createStatement();
//Resultset.type_scroll_sensitive,
//ResultSet.concur_updatable);
String sql = "select * from TABLE5";
ResultSet rs = stmt.executeQuery(sql);
while (rs.next()) {
%>
<tr class="style1"align="left">
<td><%=rs.getString("ID1") %></td>
<td><%=rs.getString("NAME1") %></td>
<td><%=rs.getString("GUIGE") %></td>
<td><%=rs.getString("DANWEI") %></td>
<td><%=rs.getString("NUM") %></td>
<td><%=rs.getString("JIAGE") %></td>
<td><%=rs.getString("CHANDI") %></td>
<td><%=rs.getString("ID2") %></td>
<td><%=rs.getString("NAME2") %></td>
<td><%=rs.getString("DIZHI") %></td>
<td><%=rs.getString("DIANHUA") %></td>
<td><%=rs.getString("TIME") %></td>
</tr>
<%}
rs.close();
stmt.close();
con.close();
%>
</table>
</body>
</html>