asp 代码如何在一行并排显示

来源:百度知道 编辑:UC知道 时间:2024/05/09 15:59:10
<TABLE WIDTH="100%" ALIGN="center" BORDER="0" CELLSPACING="0" CELLPADDING="0" height="44">
<tr>
<td height="25" align="center" class=table-xia colspan="3"><b><font color=#ff6600><% = strcat %>商品分类</font></b></td>
</tr>
<%
set rs = server.CreateObject("adodb.recordset")
rs.open "select categoryid,sortsid,sorts from sorts where sorts.categoryid="&catid&" order by sortsorder",conn,1,1
if rs.eof and rs.bof then %>
<div align="center">暂无此商品小类</div>
<%else
do while not rs.eof %>
<TR><TD HEIGHT="20" width="46%" align="right">
<a href=class.asp?aid=<% = rs("categoryid") %>&nid=<% = rs("sortsid") %>><%

把rs.movenext写到<tr></tr>的里面,<td></td>的外面
这样就可以并排显示了
else %>
<td width="46%" height="20"><a href=class.asp?aid=<% = rs("categoryid") %>&nid=<% = rs("sortsid") %>><% = rs("sorts") %></a></TD>
<% rs.movenext
end if

loop
end if
rs.close
set rs = nothing %>

</TR>

改成这样!