asp多行多列分页显示问题

来源:百度知道 编辑:UC知道 时间:2024/09/22 11:28:03
<table width="950" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td height="25">
(以添加时间为序)</td>
</tr>
<tr>
<td>
<%
sql="select * from link where linkid>0 order by linkid DESC"
set rs=conn.execute(sql)
if Rs.eof then
response.write "暂无信息"
else
do while not rs.eof
%>
<table width="100%" border="0" cellpadding="0" cellspacing="6" bgcolor="#FFFFFF">
<tr>
<%
for i=1 to 6 ' 这2是列数
if not rs.eof then
%>
<td align="center"><a href="<%=rs("siteurl")%>" target="_blank" ><img src="<%=(rs("imageurl"))%>" width=&q

太乱啦!!!
如果是我,我会这么写

<table width="950" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td height="25">
(以添加时间为序)</td>
</tr>

<%
sql="select * from link where linkid>0 order by linkid DESC"
set rs=conn.execute(sql)
if Rs.eof then
response.write "暂无信息"
else
dim i

do while not rs.eof
i=i+1
if i mod 6=0 then Response.Write("<tr>")
%>
<td align="center"><a href="<%=rs("siteurl")%>" target="_blank" ><img src="<%=(rs("imageurl"))%>" width="150" height="110" border="0"></a><br>
<%=rs("sitename")%><br><font color="#FF0000"><%=rs("