这个代码怎么改?

来源:百度知道 编辑:UC知道 时间:2024/05/09 11:24:22
sub home_gg_x(canshu)
Response.Write "<table width=760 height=60 border=0 align=center cellpadding=1 cellspacing=1><tr align=center>"
set gg= conn.execute("select top 4 tp,url from tp where lbid=6 and wz="&clng(canshu)&" and zt=0 order by id desc")
if not gg.eof then
do while not gg.eof
Response.Write("<td width=25%\><a href="&gg("url")&" target=_blank><img src='tp/gg/"&gg("tp")&"' width='188' height='60' border='0'></a></td>")
gg.movenext
loop
end if
gg.close
set gg=nothing
Response.Write "</tr></table>"
end sub
这段是一个图片显示为4个1行的代码?我想改为8个2行,怎么改,谢谢!

sub home_gg_x(canshu)
Response.Write "<table width=760 height=60 border=0 align=center cellpadding=1 cellspacing=1><tr align=center>"
set gg= conn.execute("select top 4 tp,url from tp where lbid=6 and wz="&clng(canshu)&" and zt=0 order by id desc")
if not gg.eof then
dim i
i=1
do while not gg.eof
Response.Write("<td width=25%\><a href="&gg("url")&" target=_blank><img src='tp/gg/"&gg("tp")&"' width='188' height='60' border='0'></a></td>")
if i mod 4=0 then
response.write("</tr><tr align=center>")
end if
gg.movenext
i=i+1
loop
end if
gg.close
set gg=nothing
Response.Write "</tr></table>"
end sub

试试吧。
sub home_gg_x(canshu)
Dim i
i=0
Response.Writ