asp如何实现新闻列表分两列显示?在线等待,急救,谢谢
1个回答
展开全部
给你一个例子:
<table align="center" cellpadding="0" cellspacing="0" border="0" width="779">
<%
set rs=server.CreateObject("ADODB.Recordset")
rs.Open "Select * from User",conn
Dim intCount
intCount=0
While Not rs.eof
intCount=intCount+1
If intCount mod 2 <>0 Then
response.write "<tr>"
End If
%><td height=20>
<%=rs("Userid")%></td>
<td><%=rs("Username")%></td>
<%
If intCount mod 2 <>0 Then
response.write "</tr>"
End If
rs.movenext
wend %></table>
<table align="center" cellpadding="0" cellspacing="0" border="0" width="779">
<%
set rs=server.CreateObject("ADODB.Recordset")
rs.Open "Select * from User",conn
Dim intCount
intCount=0
While Not rs.eof
intCount=intCount+1
If intCount mod 2 <>0 Then
response.write "<tr>"
End If
%><td height=20>
<%=rs("Userid")%></td>
<td><%=rs("Username")%></td>
<%
If intCount mod 2 <>0 Then
response.write "</tr>"
End If
rs.movenext
wend %></table>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询