asp横竖的问题

来源:百度知道 编辑:UC知道 时间:2024/05/14 05:49:27
突然记不得怎么安排横竖了,下面的代码是竖着显示的,再加什么才能横着显示啊?
<%
set rs=server.createobject("adodb.recordset")
rs.open "select top 8 id,username,area_one,area_two,company,verify from company where verify=0 order by id desc",conn,1,1
if rs.eof and rs.bof then
'
else
do while not rs.eof
%>

加表格
横着显示循环td
竖着现实循环tr
就可以了

加表格,
<%
set rs=server.createobject("adodb.recordset")
rs.open "select top 8 id,username,area_one,area_two,company,verify from company where verify=0 order by id desc",conn,1,1
if rs.eof and rs.bof then
'
else
%>
<table><tr>
<%
do while not rs.eof

%>

<td><%
if not rs.eof then
%>内容<%
rs.movenext
end if
%></td>
<td><%
if not rs.eof then
%>内容<%
rs.movenext
end if
%></td>
<%
if rs.eof then exit do
loop
%>
</tr>
</table>

用表格试试
<table width="200" border="1">
<tr>
<%
set rs=server.createobject("adodb.recordset")
rs.open "select top 8 id,username,area_one,area_two,company,verify from comp