桦山涧

桦山涧
Asp.net ---->知识改变命运!
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

关于分页显示中的换行显示原理代码

Posted on 2007-07-15 09:54  桦林  阅读(483)  评论(0编辑  收藏  举报
<!--#include file="conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<%
 Dim rs
 Set rs=server.CreateObject("adodb.recordset")
 sql="select * from test1 "
 rs.open sql ,conn,1
%>
<body>
<table width="80%" border="1" cellpadding="1" cellspacing="5" bordercolor="#9900FF" bgcolor="#0000FF">
<tr>
<%
i=0
do while not rs.eof
if i mod 2<>0 then
%>
<td bgcolor="#FFFFFF"><%=rs(0)%><%=rs(1)%></td>
<%else%>
</tr>
<tr>
<td bgcolor="#FFFFFF"><%=rs(0)%><%=rs(1)%></td>

<%
end if
i=i+1
rs.movenext
loop
rs.close
conn.close
%>
 </tr>
</table>
<p>&nbsp;</p>
<table width="43%" border="1" align="center" cellpadding="1" cellspacing="0">
  <tr>
    <td>1</td>
    <td>2</td>
  </tr>
  <tr>
    <td>3</td>
    <td>4</td>
  </tr>
  <tr>
    <td>5</td>
    <td>6</td>
  </tr>
</table>
<p>&nbsp;</p>
</body>
</html>