|
以下是引用xing599666在2005-5-17 21:49:46的发言: <table align="center" border="0" width="100%" cellspacing="0" cellpadding="0"> <% dim rs,sql,topbest sql="select * from pic WHERE tuijian = true order by hits desc" Set rs= Server.CreateObject("ADODB.Recordset") rs.open sql,conn,1,1 topbest=1 if rs.eof and rs.bof then response.write "<p align='center'>没有任何图片</p>" else i=0 do while not rs.eof or rs.bof if not rs.eof then %> <tr> <td align="center"><a href="list.asp?id=<%=rs("id")%>"> <img src="<%=rs("pic")%>" width="120" height="130" border="0"></a><br><%=rs("name")%></td> <% rs.movenext%> <td align="center"><a href="list.asp?id=<%=rs("id")%>"> <img src="<%=rs("pic")%>" width="120" height="130" border="0"></a><br><%=rs("name")%></td> <% rs.movenext%> <td align="center"><a href="list.asp?id=<%=rs("id")%>"> <img src="<%=rs("pic")%>" width="120" height="130" border="0"></a><br><%=rs("name")%></td> <% rs.movenext%> <td align="center"><a href="list.asp?id=<%=rs("id")%>"> <img src="<%=rs("pic")%>" width="120" height="130" border="0"></a><br><%=rs("name")%></td> </tr> <%rs.movenext end if topbest=topbest+4 if rs.eof or topbest>8 then exit do end if loop rs.close set rs=nothing end if%> </table> 上面的代码怎么让他4X2排列了如: ---------------------------------------------
如果我做我就做一个判断控制不过这样应该能够实现你要的结果 |
|