谁懂asp代码的,帮帮我好吗?怎么改下面代码成为一行三个商品展示
'================================================='过程名:ShowSmallClass_Tree'作用:树形目录方式显...
'=================================================
'过程名:ShowSmallClass_Tree
'作 用:树形目录方式显示栏目
'参 数:无
'=================================================
sub ShowSmallClass_Tree()
if rsBigClass.bof and rsBigClass.eof then
response.Write "栏目正在建设中……"
else
dim sqlClass,rsClass,strTree,BigClassNum,i,j
rsBigClass.movefirst
BigClassNum=rsBigClass.recordcount
i=1
do while not rsBigClass.eof
if i<BigClassNum then
strTree=""
else
strTree=""
end if
sqlClass="select * from SmallClass where BigClassName='" & rsBigClass("BigClassName") & "' Order by SmallClassID"
Set rsClass= Server.CreateObject("ADODB.Recordset")
rsClass.open sqlClass,conn,1,1
strTree= strTree & "<table width=180 border=0 cellpadding=0 cellspacing=0>"
strTree= strTree & "<tr>"
strTree= strTree & "<td width=24 height=22>"
strTree= strTree & "<div align=center><img src=Img/arrow_2.gif width=13 height=11></div></td>"
strTree= strTree & "<td width=150>"
strTree= strTree & "<a href='Product.asp?BigClassName=" & rsBigClass("BigClassName") & "'>"
strTree=strTree & rsBigClass("BigClassName")
strTree=strTree & "</a></td>"
'strTree=strTree & "</td>"
strTree= strTree & "</tr><tr>"
strTree=strTree & "<TD height=1 colspan=2 background=img/naSzarym.gif>"
strTree=strTree & "</TR>"
strTree=strTree & "</table>"
SmallClassNum=rsClass.recordcount
j=2
do while not rsClass.eof
rsClass.movenext
j=j+1
loop
response.write strTree
rsBigClass.movenext
i=i+2
loop
rsClass.close
set rsClass=nothing
end if
end sub
懂修改的朋友可不可留一个Q给我啊!我对代码不是很懂的啊! 展开
'过程名:ShowSmallClass_Tree
'作 用:树形目录方式显示栏目
'参 数:无
'=================================================
sub ShowSmallClass_Tree()
if rsBigClass.bof and rsBigClass.eof then
response.Write "栏目正在建设中……"
else
dim sqlClass,rsClass,strTree,BigClassNum,i,j
rsBigClass.movefirst
BigClassNum=rsBigClass.recordcount
i=1
do while not rsBigClass.eof
if i<BigClassNum then
strTree=""
else
strTree=""
end if
sqlClass="select * from SmallClass where BigClassName='" & rsBigClass("BigClassName") & "' Order by SmallClassID"
Set rsClass= Server.CreateObject("ADODB.Recordset")
rsClass.open sqlClass,conn,1,1
strTree= strTree & "<table width=180 border=0 cellpadding=0 cellspacing=0>"
strTree= strTree & "<tr>"
strTree= strTree & "<td width=24 height=22>"
strTree= strTree & "<div align=center><img src=Img/arrow_2.gif width=13 height=11></div></td>"
strTree= strTree & "<td width=150>"
strTree= strTree & "<a href='Product.asp?BigClassName=" & rsBigClass("BigClassName") & "'>"
strTree=strTree & rsBigClass("BigClassName")
strTree=strTree & "</a></td>"
'strTree=strTree & "</td>"
strTree= strTree & "</tr><tr>"
strTree=strTree & "<TD height=1 colspan=2 background=img/naSzarym.gif>"
strTree=strTree & "</TR>"
strTree=strTree & "</table>"
SmallClassNum=rsClass.recordcount
j=2
do while not rsClass.eof
rsClass.movenext
j=j+1
loop
response.write strTree
rsBigClass.movenext
i=i+2
loop
rsClass.close
set rsClass=nothing
end if
end sub
懂修改的朋友可不可留一个Q给我啊!我对代码不是很懂的啊! 展开
1个回答
展开全部
用层来做
<table width="100%" border="0" cellspacing="1" ><tr align="center" ><td valign="top">
<div style="width:900px;height:500px;" >
<%
set RSs=conn.execute( "select * from shop ")
if not(RSs.eof or RSs.bof) then
do while not RSs.eof
%>
<div style="height:40px;width:210px;display:inline">
<table width="200" border="0" cellpadding="5" cellspacing="1" bgcolor="#8498CB">
<tr bgcolor="#FFFFFF" onMouseOver="this.style.backgroundColor='#EAEBF7';" onMouseOut="this.style.backgroundColor='#FFFFFF';">
<td width="200" height="20" align="center" valign="top"><a href="shopFp.asp" title="aaa">商店名</a></td>
</tr>
</table>
</div>
<%
RSs.movenext
loop
else
%>
<tr align="center">
<td colspan="11" bgcolor="#FFFFFF">暂时还没有商店信息!</td>
</tr>
<%
end if
RSs.close
set RSs=nothing
%>
</div>
</td></tr></table>
一行显示几列由两个div的宽度来决定,比如900/210实际上就是循环4个整数!
<table width="100%" border="0" cellspacing="1" ><tr align="center" ><td valign="top">
<div style="width:900px;height:500px;" >
<%
set RSs=conn.execute( "select * from shop ")
if not(RSs.eof or RSs.bof) then
do while not RSs.eof
%>
<div style="height:40px;width:210px;display:inline">
<table width="200" border="0" cellpadding="5" cellspacing="1" bgcolor="#8498CB">
<tr bgcolor="#FFFFFF" onMouseOver="this.style.backgroundColor='#EAEBF7';" onMouseOut="this.style.backgroundColor='#FFFFFF';">
<td width="200" height="20" align="center" valign="top"><a href="shopFp.asp" title="aaa">商店名</a></td>
</tr>
</table>
</div>
<%
RSs.movenext
loop
else
%>
<tr align="center">
<td colspan="11" bgcolor="#FFFFFF">暂时还没有商店信息!</td>
</tr>
<%
end if
RSs.close
set RSs=nothing
%>
</div>
</td></tr></table>
一行显示几列由两个div的宽度来决定,比如900/210实际上就是循环4个整数!
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询