ASP中,调用数据库排列问题

来源:百度知道 编辑:UC知道 时间:2024/05/17 13:39:34
在以下表格加入代码后就会出现数据库中的内容不断往下排列到完
我想改为往右排列数据库的表格
往右排列5行后跳到第二行继续往右排列
该怎么加入代码?

<%do while not rs.eof%>

<tr>
<td width="300" height="20"><a href="del_special.asp?id=<%=rs("id")%>"><%=rs("special")%> (<%=rs("name")%>) <%=rs("picture")%></td>
</tr>

<%
rs.movenext
loop
%>

不好意思,刚刚没考虑全,又改了下,你试一下
<tr>
<%
rs_num=conn.execute("select count(*) from 表名")(0)
for ii = 0 to rs_num/5
i=0
rs.move ii*5
do while not rs.eof and i=<5
%>

<td width="300" height="20"><a href="del_special.asp?id=<%=rs("id")%>"><%=rs("special")%> (<%=rs("name")%>) <%=rs("picture")%></td>

<%
i=i+1
rs.movenext
loop
Next
%>
</tr>