为什么这段代码不能实现每横向显示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>
<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>
<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语句)
内容不多,原理很简单易学,最基础的语言技术常识。