下面这个ASP代码是显示二行六张图片,我想修改成一行四张,从哪修改》请指点~!

<%response.write"<tableborder=0cellpadding=0cellspacing=0width='100%'>"setrslar=conn.... <%
response.write "<table border=0 cellpadding=0 cellspacing=0 width='100%'>"
set rslar=conn.execute("select * from bclass where LarSeq=4")
if rslar.bof and rslar.eof then
larseqq="无"
else
larseqq=rslar("LarCode")
end if
set rslar=nothing
set rs=conn.execute("select top 6 * from bproduc where online=true and LarCode='"&larseqq&"' order by AddDate desc")
if rs.bof and rs.eof then
response.write "<tr><td height=150 align=center><font color=#FC922C><b>暂时没有商品</b></font></td></tr>"
else
k=0
Do While Not rs.eof
response.write "<tr>"
for i=1 to 6
k=k+2
response.write "<td align='center' valign='top' width=128 height=100>"
response.write "<table border=0 cellspacing=0 cellpadding=1 valign=middle align=center width=128 height=100>"
response.write "<tr><td align=center valign=middle><a href='list.asp?ProdId="&rs("ProdId")&"' target=_blank><img border=0 onload='DrawImage1(this)' alt="&rs("ProdName")&" src="&rs("ImgPrev")&"></a></td></tr>"
response.write "<tr><td align=center><a href='list.asp?ProdId="&rs("ProdId")&"' target=_blank><font color=#FC922C>"&lleft(rs("ProdName"),18)&"</font></a></td></tr>"
response.write "</table></td>"
if (k mod 3=0) and k>=3 then
response.write "</tr><tr>"
end if
rs.movenext
if k>5 then exit do
next
loop
response.write "</tr>"
end if
set rs=nothing
response.write "</table>"
%>
展开
 我来答
winhoo63
2012-11-14 · 超过40用户采纳过TA的回答
知道小有建树答主
回答量:184
采纳率:0%
帮助的人:87.3万
展开全部
<%
response.write "<table border=0 cellpadding=0 cellspacing=0 width='100%'>"
set rslar=conn.execute("select * from bclass where LarSeq=4")
if rslar.bof and rslar.eof then
larseqq="无"
else
larseqq=rslar("LarCode")
end if
set rslar=nothing
set rs=conn.execute("select top 6 * from bproduc where online=true and LarCode='"&larseqq&"' order by AddDate desc")
if rs.bof and rs.eof then
response.write "<tr><td height=150 align=center><font color=#FC922C><b>暂时没有商品</b></font></td></tr>"
else
k=0
Do While Not rs.eof
response.write "<tr>"
for i=1 to 4
k=k+2
response.write "<td align='center' valign='top' width=128 height=100>"
response.write "<table border=0 cellspacing=0 cellpadding=1 valign=middle align=center width=128 height=100>"
response.write "<tr><td align=center valign=middle><a href='list.asp?ProdId="&rs("ProdId")&"' target=_blank><img border=0 onload='DrawImage1(this)' alt="&rs("ProdName")&" src="&rs("ImgPrev")&"></a></td></tr>"
response.write "<tr><td align=center><a href='list.asp?ProdId="&rs("ProdId")&"' target=_blank><font color=#FC922C>"&lleft(rs("ProdName"),18)&"</font></a></td></tr>"
response.write "</table></td>"
if (k mod 3=0) and k>=3 then
response.write "</tr><tr>"
end if
rs.movenext
if k>3 then exit do
next
loop
response.write "</tr>"
end if
set rs=nothing
response.write "</table>"
%>

你试试
追问
不行,只显示两张了~!
追答
"
set rslar=conn.execute("select * from bclass where LarSeq=4")
if rslar.bof and rslar.eof then
larseqq="无"
else
larseqq=rslar("LarCode")
end if
set rslar=nothing
set rs=conn.execute("select top 6 * from bproduc where online=true and LarCode='"&larseqq&"' order by AddDate desc")
if rs.bof and rs.eof then
response.write "暂时没有商品"
else
k=0
Do While Not rs.eof
response.write ""
for i=1 to 4
k=k+4
response.write ""
response.write ""
response.write ""
response.write ""&lleft(rs("ProdName"),18)&""
response.write ""
if (k mod 5=0) and k>=5 then
response.write ""
end if
rs.movenext
if k>4 then exit do
next
loop
response.write ""
end if
set rs=nothing
response.write ""
%>
本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
蓝鸟一生
2012-11-14 · TA获得超过128个赞
知道答主
回答量:115
采纳率:0%
帮助的人:43.6万
展开全部
这是只显示一行四张的代码,如果是要显示多行,每一行四张的话,再联系
<%
response.write "<table border=0 cellpadding=0 cellspacing=0 width='100%'>"
set rslar=conn.execute("select * from bclass where LarSeq=4")
if rslar.bof and rslar.eof then
larseqq="无"
else
larseqq=rslar("LarCode")
end if
set rslar=nothing
set rs=conn.execute("select top 4 * from bproduc where online=true and LarCode='"&larseqq&"' order by AddDate desc")
if rs.bof and rs.eof then
response.write "<tr><td height=150 align=center><font color=#FC922C><b>暂时没有商品</b></font></td></tr>"
else
response.write "<tr>"
Do While Not rs.eof

response.write "<td align='center' valign='top' width=128 height=100>"
response.write "<table border=0 cellspacing=0 cellpadding=1 valign=middle align=center width=128 height=100>"
response.write "<tr><td align=center valign=middle><a href='list.asp?ProdId="&rs("ProdId")&"' target=_blank><img border=0 onload='DrawImage1(this)' alt="&rs("ProdName")&" src="&rs("ImgPrev")&"></a></td></tr>"
response.write "<tr><td align=center><a href='list.asp?ProdId="&rs("ProdId")&"' target=_blank><font color=#FC922C>"&lleft(rs("ProdName"),18)&"</font></a></td></tr>"
response.write "</table></td>"

rs.movenext
loop
response.write "</tr>"
end if
set rs=nothing
response.write "</table>"
%>
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
木木梁
2012-11-14 · 一只大胖子,比较懒,也比较平和,三大爱好:技术(为生活),美...
木木梁
采纳数:24 获赞数:73

向TA提问 私信TA
展开全部
用DIV 写 很舒服的!
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(1)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式