为什么这段代码不能实现每横向显示3个图片就换行?

为什么这段代码不能实现每横向显示3个图片就换行?而是每显示一个图片就换行的?
<%i=-1
while not rs.eof
i=i+1
if i mod 3 =0 then%>
<%response.write "<br>"
end if
%>

<TABLE cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
<TD height=10><IMG height=10 src="images/bg_0ltop.gif"
width=10></TD>
<TD background=images/bg_01.gif height=10></TD>
<TD height=10><IMG height=10 src="images/bg_0rtop.gif"
width=10></TD>
</TR>
<TR>
<TD width=10 background=images/bg_03.gif> </TD>
<TD vAlign=center align=middle bgColor=#ffffff><IMG height=188
src="images/01_x.jpg" width=250></TD>
<TD width=10 background=images/bg_04.gif> </TD>
</TR>
<TR>
<TD height=10><IMG height=10
src="images/bg_0lbottom.gif" width=10></TD>
<TD background=images/bg_02.gif height=10></TD>
<TD height=10><IMG height=10
src="images/bg_0rbottom.gif"
width=10></TD><%
rs.movenext
wend%>
</TR>
</TBODY>
</TABLE>
[1272 byte] By [chensheng2006] at [2008-1-9]
# 1
<TABLE cellSpacing=0 cellPadding=0 align=center border=0 style="display:inline"> 加上 style="display:inline" 表格自己会换行。
cpp2017-慕白兄 at 2007-9-30 > top of Msdn China Tech,Web,ASP...
# 2
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<%
do while not zhaopinRS.eof
id = (zhaopinRS(0)*9+1-5)*4
i = i +1
%>
<td width="18" align="center" style="border-bottom:1px dashed #CCCCCC"><img src="images/arror.jpg" width="11" height="11"></td>
<td width="509" height="20" style="border-bottom:1px dashed #CCCCCC"><a href="person/resumeShow.asp?pid=<%=id%>&JID=<%=zhaopinRS(3)%>" class="style1" target="_blank"><%=zhaopinRS(2)%></a></td>
<%
zhaopinRS.movenext
if i mod 2 = 0 then
response.write "</tr><tr>"
end if
loop
zhaopinRS.close
set zhaopinRS = nothing
%>
</tr>
</table>
sy_binbin at 2007-9-30 > top of Msdn China Tech,Web,ASP...
# 3

<TABLE cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<%Do while not rs.eof%>
<TR>
<%For ii=1 to 3 then%>
<TD height=10><IMG height=10 src="&<%=rs("imagefile")%>&" width=10></TD>
<%
if not rs.eof then
rs.movenext
else
select case ii
case 1
response.write "<TD></TD><TD></TD>"
case 2
response.write "<TD></TD>"
case 3
''///表格列完整,不需要添加列
end select
exit For
end if
Next
%>
</TR>
<%Loop%>
</TBODY></TABLE>

*****看上去楼主还没有P程序流程控制的常识。建议看看关于ASP程序流程控制方面的数据
搞清楚下面的几个问题:
1、无限循环(例如:Do语句)
2、有限循环(例如:for语句)
3、是非判断分支(例如:IF语句)
4、条件选择分支(例如:select语句)
内容不多,原理很简单易学,最基础的语言技术常识。

plought at 2007-9-30 > top of Msdn China Tech,Web,ASP...
# 4
*****看上去楼主还没有通用程序流程控制的常识。建议看看关于ASP程序流程控制方面的书籍
搞清楚下面的几个问题:
1、无限循环(例如:Do语句)
2、有限循环(例如:for语句)
3、是非判断分支(例如:IF语句)
4、条件选择分支(例如:select语句)
内容不多,原理很简单易学,最基础的语言技术常识。

plought at 2007-9-30 > top of Msdn China Tech,Web,ASP...
# 5
if i mod 3 =0 then%>
<%response.write "<br>"
end if
你的上面这代码中的<br>不能使单元格<td></td>分行;
要分行必须是<tr><td></td></tr>
因此我们的分行的实现方法应该是这样:
<tr>
<%i=1
do while not rs.eof%>
<td>……</td>
<%if i>3 then
Response.Write("</tr><tr>") '<---------这是关键
i=0
else
i=i+1
end if
rs.movenext
loop%>
</tr>
qinglifeng-东方旗 at 2007-9-30 > top of Msdn China Tech,Web,ASP...
# 6
我也是做的每行显示三个图片,我是这样写的,楼主可以参考一下

<% i=0
do while not rs.eof

%>
<td>.....</td>
<%
if i mod 3 = 0 then
response.write "</tr><tr>"
%>