王者荣耀排位机制:asp中怎样在并列的信息前显示数字顺序?

来源:百度文库 编辑:高考问答 时间:2024/04/30 04:26:32
我的代码是这样的
<%

i=0

set rs=server.createobject("adodb.recordset")
rs.open "select Top 1000 * from dv_bbs1 where username='wangli' order by dateandtime desc ",conn,1,1
if rs.recordcount=0 then
%> </tr> <%
else
while not rs.eof

i=i+1

%> <tr> <td width="33%" valign=top>
<div align="left">
<table width=430 border="0" cellpadding="2" cellspacing="0">
<tr><td width="40%" VALIGN="TOP" BGCOLOR="#FFFFFF" ><DIV ALIGN="left"><img src=files/yewu.gif><%=i%><FONT COLOR="#999999"> <%response.write "<a href=# target=_blank>"
if len(trim(rs("topic")))>39 then
response.write left(trim(rs("topic")),20)&"..."
else
response.write trim(rs("topic"))
end if
response.write "</a>"
%></FONT></DIV></td><td valign=bottom width=12%><%=rs("username")%></td><td width=48% valign=bottom><%=rs("dateandtime")%></td></tr>
</table></div>
<%rs.movenext%> </td><td width="33%" valign="top" > <%if rs.eof then%>
<%else%>
<div align="left">
<TABLE WIDTH=430 BORDER="0" CELLPADDING="2" CELLSPACING="0">
<TR><TD WIDTH="40%" VALIGN="TOP" BGCOLOR="#FFFFFF" ><DIV ALIGN="left"><img src=files/yewu.gif><%=i%><FONT COLOR="#999999"> <%response.write "<a href=# target=_blank>"
if len(trim(rs("topic")))>39 then
response.write left(trim(rs("topic")),20)&"..."
else
response.write trim(rs("topic"))
end if
response.write "</a>"
%></FONT></DIV></TD><td valign=bottom width=12%><%=rs("username")%></td><td width=48% valign=bottom><%=rs("dateandtime")%></td></TR>
</TABLE></div>
<%rs.movenext%> <%end if%> </td><td width="34%" valign="top" ><%if rs.eof then%>
<%else%>
<div align="left">
<TABLE WIDTH=430 BORDER="0" CELLPADDING="2" CELLSPACING="0">
<TR><TD WIDTH="40%" VALIGN="TOP" BGCOLOR="#FFFFFF" ><DIV ALIGN="left"><img src=files/yewu.gif><%=i%><FONT COLOR="#999999"> <%response.write "<a href=# target=_blank>"
if len(trim(rs("topic")))>39 then
response.write left(trim(rs("topic")),20)&"..."
else
response.write trim(rs("topic"))
end if
response.write "</a>"
%></FONT></DIV></TD><td valign=bottom width=12%><%=rs("username")%></td><td width=48% valign=bottom><%=rs("dateandtime")%></td></TR>
</TABLE></div>
<%rs.movenext%> <%end if%> </td></tr> <%
wend
end if%> </table>

问:怎样使顺序显示为

1 6 11
2 7 12
3 8 13
4 9 14
5 10 15

给你个思路吧:

<table>
<tr>
<td>
<%
for i=1 to 20
Response.Write i & "<br>"
if i mod 5 = 0 then
response.write "</td><td>"
end if
next
%>
</td>
</tr>
</table>

嗯,单层的实现起来很麻烦..
所以可以靠多层嵌套来实现..