当前位置: 代码迷 >> ASP.NET >> 小弟我是个新手来看看好吗? 小弟我的目的是要显示3个图片自动换行,数据是循环加载的
  详细解决方案

小弟我是个新手来看看好吗? 小弟我的目的是要显示3个图片自动换行,数据是循环加载的

热度:2556   发布时间:2013-02-25 00:00:00.0
我是个新手高手进来看看好吗?? 我的目的是要显示3个图片自动换行,数据是循环加载的
<tr>
  <%do   while   not   rs.eof
i=i+1
%>
      <td> <table   width= "180 "   ID= "Table1 ">
<tr>
<td   align= "center "   width= "180 "   height= "50 "> <a   href= "LifepalyT.aspx?o=square&id={$nid} "   title= "{$ctitle} "   class= "link23 "> <img   src= "upload/life/{$filename} "   width= "150 "   height= "88 "   border= "0 "   /> </a> </td>
</tr>
<tr>
<td   align= "center "   width= "180 "   height= "10 "> <a   href= "LifepalyT.aspx?o=square&id={$nid} "   title= "{$ctitle} "   class= "link23 "> <font   color= "#000000 "> {$title} </font> </a> </td>
</tr>
</table>
</td>
<%
if   i   %   4=0   then   response.write( " </tr> <tr> ")
%>



------解决方案--------------------------------------------------------
<tr>
<%
i=0
do while not rs.eof
%>
<td> <table width= "180 " ID= "Table1 ">
<tr>
<td align= "center " width= "180 " height= "50 "> <a href= "LifepalyT.aspx?o=square&id={$nid} " title= "{$ctitle} " class= "link23 "> <img src= "upload/life/{$filename} " width= "150 " height= "88 " border= "0 " /> </a> </td>
</tr>
<tr>
<td align= "center " width= "180 " height= "10 "> <a href= "LifepalyT.aspx?o=square&id={$nid} " title= "{$ctitle} " class= "link23 "> <font color= "#000000 "> {$title} </font> </a> </td>
</tr>
</table>
</td>
<%
i=i+1
if i % 3=0 then response.write( " </tr> <tr> ")
%>
</tr>
------解决方案--------------------------------------------------------
貌似ASP的东西
i % 4=0
这个是4个换行吧?而且第一个也要换
if i > = 3 AND (i-3) % 2=0 then

------解决方案--------------------------------------------------------
哦,我的错了
没看到i=i+1
应该是if i % 3=0 then
  相关解决方案