表格的循环问题?
请问如何输出2行4列的一个表格?
上面的原始问题的答案是错误的,所以在这里从提一下,在线等,解决立即给分。
部分代码如下:
<%
Set rs = server.CreateObject( "adodb.recordset ")
sql= "select * from user order by user_id desc "
rs.Open sql, db, 1, 1
Dim pagenum
rs.pagesize = 4
Do While Not rs.EOF And i < rs.pagesize
%>
<table width= "310 " border= "0 " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td width= "122 " height= "145 "> <%=trim(rs( "user_name "))%> </td>
</tr>
</table>
<%
i = i + 1
rs.movenext
loop
%>
------解决方案-------------------- <table>
<tr>
<%
i = 1
do ....
if i mod 4 = 0 then response.write " </tr> <tr> "
response.write ( " <td> .... </td> ")
i = i + 1
rs.movenext
loop
%>
</tr>
</table>