下面这个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>"
%> 展开
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>"
%> 展开
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>"
%>
你试试
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 ""
%>
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这是只显示一行四张的代码,如果是要显示多行,每一行四张的话,再联系
<%
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>"
%>
<%
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>"
%>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
用DIV 写 很舒服的!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询