ASP调用换行

来源:百度知道 编辑:UC知道 时间:2024/09/21 15:34:46
图片要两行 三列怎么做?
a href="class.asp?lx=news">最新加入藏品</a> </div>
</div>
</div>
</div></td>
</tr>
<tr align="center" valign="top">
<td height="121"><div align="center"><table border=0 cellpadding=0 cellspacing=3 width=100%>
<tr>
<%
set rs=server.createobject("adodb.recordset")
i=0
MaxShangpinList=3

rs.open "select * from shop_snsn where newsshop=1 order by shopid desc",conn,1,1
%>
<%
do while not rs.eof
i=i+1
%>
<td align=center valign=middle><table width="200" height="103" border="0" ce

i=1
do while not rs.eof
%>
循环内容
<%
if i mod 3 =0 Then response.write ("换行的html标记")
rs.movenext
i=i+1
loop%>

i mod 3 意思是3列

2行的话,就是6个记录,sql语句 加上 top 6

大概思路如下:
i=1
do while not rs.eof
显示第一个图片
rs.movenext
i=i+1
if not rs.eof then
第二个图片
rs.movenext
i=i+1
end if

if not rs.eof then
第三个图片
rs.movenext
i=i+1
end if

换行

if not rs.eof then
第四个图片
rs.movenext
i=i+1
end if

if not rs.eof then
第五个图片
rs.movenext
i=i+1
end if

if not rs.eof then
第五个图片
rs.movenext
i=i+1
end if

if not rs.eof then
第六个图片
rs.movenext
i=i+1
end if

如果需要分页可以留着 i=i+1,不分页可以删除掉