<% i=i+1 if (i mod 5 <> 0) Then %> <TD width="3%"><INPUT style="CURSOR: hand" type=checkbox value=8 name=checked></TD><td class=t4 width="17%" align="center" bordercolor="#cccccc"> <a target="_blank" href="real/qq850.com<%=rs("id")%>.htm"><%=rs("cxn")%> - <%=rs("cxv")%> </a> </td> <%else%> <TD width="3%"><INPUT style="CURSOR: hand" type=checkbox value=8 name=checked></TD><td class=t4 width="17%" align="center" bordercolor="#cccccc"> <a target="_blank" href="real/qq850.com<%=rs("id")%>.htm"><%=rs("cxn")%> - <%=rs("cxv")%> </a> </td></tr> <%end if %> 这个是惊云中的,逢5跳怎么搞,现在这个变成了,第一行是3个就跳到下一行,下一行正常,是5个
<% i=0 if (i mod 5 <> 0) Then %> <TD width="3%"><INPUT style="CURSOR: hand" type=checkbox value=8 name=checked></TD><td class=t4 width="17%" align="center" bordercolor="#cccccc"> <a target="_blank" href="real/qq850.com<%=rs("id")%>.htm"><%=rs("cxn")%> - <%=rs("cxv")%> </a> </td> <%else%> <TD width="3%"><INPUT style="CURSOR: hand" type=checkbox value=8 name=checked></TD><td class=t4 width="17%" align="center" bordercolor="#cccccc"> <a target="_blank" href="real/qq850.com<%=rs("id")%>.htm"><%=rs("cxn")%> - <%=rs("cxv")%> </a> </td></tr> <%end if i=i+1 %>
准确地说,i = 0 应该放到循环外。 代码: i = 0 Do While ... If i Mod 5 <> 0 Then ... Else ... End If i = i + 1 rs.MoveNext Loop
<% i=1 sql="select top 100 cxn,cxv,id,tid,date from down where cd='华人男歌手' order by date desc" rs.open sql,conn,1,1 if rs.eof then%> <% else do while not rs.eof %> <%if (i mod 5 <> 0) Then %> <TD width="3%"><INPUT style="CURSOR: hand" type=checkbox value=8 name=checked></TD><td class=t4 width="17%" align="center" bordercolor="#cccccc"> <a target="_blank" href="real/qq850.com<%=rs("id")%>.htm"><%=rs("cxn")%> - <%=rs("cxv")%> </a> </td> <%else%> <TD width="3%"><INPUT style="CURSOR: hand" type=checkbox value=8 name=checked></TD><td class=t4 width="17%" align="center" bordercolor="#cccccc"> <a target="_blank" href="real/qq850.com<%=rs("id")%>.htm"><%=rs("cxn")%> - <%=rs("cxv")%> </a> </td></tr> <%end if %> <%i=i+1%> <% i=i+1 if i>100 then exit do rs.movenext loop end if rs.close %> 全部代码在这里了