asp中怎样在并列的信息前显示数字顺序?

来源:百度知道 编辑:UC知道 时间:2024/05/15 14:39:40
我的代码是这样的
<%

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)&"..."

给你个思路吧:

<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>

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