ASP 横着排列显示问题

来源:百度知道 编辑:UC知道 时间:2024/05/26 14:29:11
<table width="697" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top"><table width="95%" border="0" cellspacing="0" cellpadding="0">
<%
set rs=server.createobject("adodb.recordset")
sql="select * from shop_class2 order by shop_class_id"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write ""
else
do while not rs.eof
%><tr><td height="40"><img src="image/bbtt.gif" width="13" height="14" align="absmiddle"> <strong><%=rs(1)%></strong></td></tr>
<tr><td height="1" bgcolor="#FE5A5F"></td></tr>
<tr><td height="120">

<table border="0"

'楼主的问题不知是否已解决了,如下方法不妨一试.
<tr><td height="120"> '在此直接贴入代码
<table width="78%" border="0" cellspacing="1" cellpadding="0" align=center>
<tr>
<%
n=1
set rts=server.createobject("adodb.recordset")
sql="select top 4 * from shop2 where shop_class_id = "& rs(0) &" order by shop_id" '备注说明:这裏既然你要横著显示6个标题,再换行,为何top 4呢,请楼主根据你的需求调整.
rts.open sql,conn,1,1
if rts.eof and rts.bof then
response.write ""
else
while not rts.eof
%>
<td align="left"><a href="shoplist2.asp?shop_id=<%=rts("shop_id")%>" target="_blank"><%=rts(1)%></a></td>
<%If n mod 6=0 Then%>
</tr>
<%
end if
n=n+1
rts.movenext
wend
rts.close
Set rts=Nothing
%>
</table></td>