日期:2014-05-16  浏览次数:20800 次

asp从数据库中读出数据,请问如何3个1行,第四个换行
asp从数据库中读出数据,请问如何3个1行,第四个换行。

<a href="show.asp?id=<%=rs("t_id")%>" ><img src="<%=rs("t_pic")%>"  /></a><br/><a href="show.asp?id=<%=rs("t_id")%>" target="_blank" title="<%=rs("t_name")%>"><%=left(rs("t_name"),12)%></a>

我是用以前的代码写的,读出出来的数据每个数据都会自动换行。

请问如何3个1行,第四个换行。

------解决方案--------------------
用条件
if i mod 3=0 then 整除3就换行
------解决方案--------------------
不知道有没理解错

on error resume next
rs.movefirst
i=0
while not rs.eof

  <a href="show.asp?id=<%=rs("t_id")%>" ><img src="<%=rs("t_pic")%>"  /></a><br/><a href="show.asp?id=<%=rs("t_id")%>" target="_blank" title="<%=rs("t_name")%>"><%=left(rs("t_name"),12)%></a>


i=i+1
if(i mod 3==0) then 
  response.write("<br/>")
end if  
  rs.movenext
wend