asp一排2行的类别列表请高手帮忙分成3行一排
如题.目前代码从数据库读出来的样式为A|B从行开始循环,要修改成A|B|C然后开始循环。请高手帮忙改一下代码。如下:<%setrs=server.CreateObject...
如题.
目前代码从数据库读出来的样式为 A|B 从行开始循环,要修改成 A|B|C 然后开始循环。
请高手帮忙改一下代码。如下:
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from bsort order by anclassidorder",conn,1,1
if rs.recordcount=0 then
response.write "<br>目前没有分类"
else
while not rs.eof
%>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td colspan="3" height="22" align="left"><font color="#FF6600"><img src="/images/bullet.gif" width="9" height="7" /><a href="way.asp?lx=big&anid=<%=rs("anclassid")%>"><font color="#FF4800"><strong><%=rs("anclass")%></strong></font></a></font></td>
</tr>
<%
set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from ssort where anclassid=" & rs("anclassid") & " order by nclassidorder",conn,1,1
if rs_s.recordcount=0 then
%>
<tr>
<td colspan="3" height="22">暂无小分类</td>
</tr>
<%
else
i=0
while not rs_s.eof
%>
<tr>
<td width="48%" height="20" align="right"><a href="nway.asp?lx=small&anid=<%=rs("anclassid")%>&nid=<%=rs_s("nclassid")%>"><%=rs_s("nclass")%></a></td>
<td width="4%" align="center"><font color="ff6600"><b>|</b></font></td>
<%rs_s.movenext
if rs_s.eof then
response.write "<td align=center> </td></tr>"
else
%>
<td align="left" width="48%" height="22" ><a href="nway.asp?lx=small&anid=<%=rs("anclassid")%>&nid=<%=rs_s("nclassid")%>"><%=rs_s("nclass")%></a></td>
</tr>
<%
rs_s.movenext
end if%>
<%
wend
end if
%>
</table>
<%
rs_s.close
set rs_s=nothing
rs.movenext
wend
end if
rs.close
set rs=nothing
%> 展开
目前代码从数据库读出来的样式为 A|B 从行开始循环,要修改成 A|B|C 然后开始循环。
请高手帮忙改一下代码。如下:
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from bsort order by anclassidorder",conn,1,1
if rs.recordcount=0 then
response.write "<br>目前没有分类"
else
while not rs.eof
%>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td colspan="3" height="22" align="left"><font color="#FF6600"><img src="/images/bullet.gif" width="9" height="7" /><a href="way.asp?lx=big&anid=<%=rs("anclassid")%>"><font color="#FF4800"><strong><%=rs("anclass")%></strong></font></a></font></td>
</tr>
<%
set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from ssort where anclassid=" & rs("anclassid") & " order by nclassidorder",conn,1,1
if rs_s.recordcount=0 then
%>
<tr>
<td colspan="3" height="22">暂无小分类</td>
</tr>
<%
else
i=0
while not rs_s.eof
%>
<tr>
<td width="48%" height="20" align="right"><a href="nway.asp?lx=small&anid=<%=rs("anclassid")%>&nid=<%=rs_s("nclassid")%>"><%=rs_s("nclass")%></a></td>
<td width="4%" align="center"><font color="ff6600"><b>|</b></font></td>
<%rs_s.movenext
if rs_s.eof then
response.write "<td align=center> </td></tr>"
else
%>
<td align="left" width="48%" height="22" ><a href="nway.asp?lx=small&anid=<%=rs("anclassid")%>&nid=<%=rs_s("nclassid")%>"><%=rs_s("nclass")%></a></td>
</tr>
<%
rs_s.movenext
end if%>
<%
wend
end if
%>
</table>
<%
rs_s.close
set rs_s=nothing
rs.movenext
wend
end if
rs.close
set rs=nothing
%> 展开
1个回答
展开全部
<!--#include file="conn.asp" -->
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from bsort order by anclassidorder",conn,1,1
if rs.recordcount=0 then
response.write "<br>目前没有分类"
else
do while not rs.eof
%>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td colspan="3" height="22" align="left"><font color="#FF6600"><img src="/images/bullet.gif" width="9" height="7" /><a href="way.asp?lx=big&anid=<%=rs("anclassid")%>"><font color="#FF4800"><strong><%=rs("anclass")%></strong></font></a></font></td>
</tr>
<%
set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from ssort where anclassid=" & rs("anclassid") & " order by nclassidorder",conn,1,1
if rs_s.recordcount=0 then
%>
<tr>
<td colspan="3" height="22">暂无小分类</td>
</tr>
<tr>
<%
else
i=1
do while not rs_s.eof
%>
<td width="30%" height="20" align="right"><a href="nway.asp?lx=small&anid=<%=rs("anclassid")%>&nid=<%=rs_s("nclassid")%>"><%=rs_s("nclass")%></a></td>
<%if i mod 3 = 0 then
response.Write(" <td align=center> </td></tr><tr>")
else
response.Write("<td width=4% align=center><font color=ff6600><b>|</b></font></td>")
end if
rs_s.movenext
i=i+1
loop
rs_s.close
end if%>
</tr>
</table>
<%
rs_s.close
set rs_s=nothing
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from bsort order by anclassidorder",conn,1,1
if rs.recordcount=0 then
response.write "<br>目前没有分类"
else
do while not rs.eof
%>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td colspan="3" height="22" align="left"><font color="#FF6600"><img src="/images/bullet.gif" width="9" height="7" /><a href="way.asp?lx=big&anid=<%=rs("anclassid")%>"><font color="#FF4800"><strong><%=rs("anclass")%></strong></font></a></font></td>
</tr>
<%
set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from ssort where anclassid=" & rs("anclassid") & " order by nclassidorder",conn,1,1
if rs_s.recordcount=0 then
%>
<tr>
<td colspan="3" height="22">暂无小分类</td>
</tr>
<tr>
<%
else
i=1
do while not rs_s.eof
%>
<td width="30%" height="20" align="right"><a href="nway.asp?lx=small&anid=<%=rs("anclassid")%>&nid=<%=rs_s("nclassid")%>"><%=rs_s("nclass")%></a></td>
<%if i mod 3 = 0 then
response.Write(" <td align=center> </td></tr><tr>")
else
response.Write("<td width=4% align=center><font color=ff6600><b>|</b></font></td>")
end if
rs_s.movenext
i=i+1
loop
rs_s.close
end if%>
</tr>
</table>
<%
rs_s.close
set rs_s=nothing
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询