<table border="0" cellpadding="1" cellspacing="1" bgcolor="#EDEDED">
<tr>
<%
'表中每行显示五条记录
i = 0
sSql = "SELECT ID,USERNAME FROM USERINFO WHERE STATUS=0"
Set oRs = sqlNoParamReturnRs(sSql)
oRsCount = oRs.RecordCount
While Not oRs.Eof
i = i + 1
userID = oRs("ID")
userName = oRs("USERNAME")
stu = " "&userName&" <input type='checkbox' name='userID' value="&userID&"> "
If(i = 6) Then
Response.Write("</tr><tr>")
i = i - 5
End If
Response.Write("<td width='16%' bgcolor='#FFFFFF' align='right'>"&stu&"</td>")
oRs.MoveNext
Wend
oRs.close
If (oRsCount <> 0) Then
For k = 1 To (5 - i)
Response.Write("<td width='20%' bgcolor='#FFFFFF'> </td>")
Next
End If
Set oRs = Nothing
Set conn = Nothing
%>
</tr>
</table>
每行显示六个的你自己改下代码就可以了。
<table>
<%
sql="select * from zg_article"
openrs rs,sql,1,1
i=1
do while not rs.eof
%>
<tr>
<%
j=1
do while not rs.eof
%>
<td width="20%"><%=rs("title")%>
</td>
<%rs.movenext
j=j+1
if j>5 then exit do
loop%>
</tr>
<%
i=i+1
if i>5 then exit do
loop
%>