asp 循环换行的问题 大家帮忙啊

来源:百度知道 编辑:UC知道 时间:2024/05/31 11:58:46
请教一个asp循环的问题 大家帮忙啊

<table >
<tr>

<td ><table width="180" height="200" >
<tr>
<td height="179" ><img src="pic/1.jpg" /></td>
</tr>
<tr>
<td height="20">标题1</td>
</tr>
</table></td>
<td ><table width="180" height="200" >
<tr>
<td height="179" ><img src="pic/2.jpg" /></td>
</tr>
<tr>
<td height="20">标题2</td>
</tr>
</table></td>
<td ><table width=&

<%
' 假设conn为已经连接上数据库
' 选择前9条数据库,可以近一不使用order by来进行排序
set rs = conn.execute("select top 9 PhotoUrl, title from 表")
if not rs.eof then
%>
<table >
<tr>
<%
for i = 1 to 9
if rs.eof then
'如果没有9条记录可以根据自己需要来进行补空操作,或者留空
else
%>
<td ><table width="180" height="200" >
<tr>
<td height="179" ><img src="<%=rs("PhotoUrl")%>" /></td>
</tr>
<tr>
<td height="20"><%=rs("title")%></td>
</tr>
</table></td>
<%
rs.movenext
end if
if i mod 3 = 0 and i <> 9 then response.write "</tr><tr>"
%>
</tr>
</table>
&