注册 登录
编程论坛 ASP技术论坛

功能实现问题

s6gy 发布于 2007-12-05 15:11, 591 次点击
在一个 表格里面 《TR   》 《TD》《/TD》《TD》《/TD》《TD》《/TD》《/TR》


在一行里 显示三条后在换行循环下面的
数据怎么实现
帮忙啊
4 回复
#2
madpbpl2007-12-05 15:54
假设记录集为rs
<%
cols=1
do while not rs.eof
if  cols>1 and cols mod 3=1 then
response.write "</tr><tr>"
%>
<td>显示的内容</td>
<%
cols=cols+1
rs.movenext
loop
%>
#3
s6gy2007-12-05 16:17
老大写详细点撒
郁闷哦不行哦
#4
madpbpl2007-12-05 17:32
原帖由 [bold][underline]s6gy[/underline][/bold] 于 2007-12-5 16:17 发表 [url=http://bbs.bc-cn.net/redirect.php?goto=findpost&pid=1132657&ptid=190560][/url]
老大写详细点撒
郁闷哦不行哦

怎么不行了?楼主有具体的代码吗?
#5
tang6882007-12-06 08:26
<table>
<%
for  n=1 to rs.recordcount
if  n mod 3=1 then
  response.write "<tr>"
end if
%>
<td><%=rs("字段名")%></td>
<%
if  n mod 3=0 then
  response.write "</tr>"
end if

rs.movenext
next
if n mod 3=1 then
  response.write "<td></td><td></td></tr>"
elseif n mod 3=2 then
response.write "<td></td></tr>"
end if
%></table>

[[italic] 本帖最后由 tang688 于 2007-12-6 08:33 编辑 [/italic]]
1