当前位置: 代码迷 >> ASP >> asp从数据库中读出数据,请教怎么3个1行,第四个换行
  详细解决方案

asp从数据库中读出数据,请教怎么3个1行,第四个换行

热度:67   发布时间:2013-06-19 10:26:41.0
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
  相关解决方案