asp横向排4张图片,修改下代码
setrs=server.createobject("adodb.recordset")sql="select*fromAmeav_FriendSiteorderbyid...
set rs = server.createobject("adodb.recordset")
sql="select * from Ameav_FriendSite order by id desc"
rs.open sql,conn,1,1
i=1
do while not rs.eof
if i mod 5=0 then response.write"</tr><tr>"
SiteFace=rs("SiteName")
response.write "<td class='text' align='center' valign='top'><a target='_blank' href='fengcai.asp?ID="&rs("id")&"' target='_blank' title=描述:"&rs("Remark")&"><img src='"&rs("SiteFace")&"' width='150' height='140' vspace='-10' hspace='10' style='border:2px solid #cccccc''></a>"&_
"<br><h3 class='ma'><a target='_blank' href='fengcai.asp?ID="&rs("id")&"'>"&rs("SiteName")&"</a></h3></td>"
rs.movenext
i=i+1
loop
rs.Close
set rs=nothing 展开
sql="select * from Ameav_FriendSite order by id desc"
rs.open sql,conn,1,1
i=1
do while not rs.eof
if i mod 5=0 then response.write"</tr><tr>"
SiteFace=rs("SiteName")
response.write "<td class='text' align='center' valign='top'><a target='_blank' href='fengcai.asp?ID="&rs("id")&"' target='_blank' title=描述:"&rs("Remark")&"><img src='"&rs("SiteFace")&"' width='150' height='140' vspace='-10' hspace='10' style='border:2px solid #cccccc''></a>"&_
"<br><h3 class='ma'><a target='_blank' href='fengcai.asp?ID="&rs("id")&"'>"&rs("SiteName")&"</a></h3></td>"
rs.movenext
i=i+1
loop
rs.Close
set rs=nothing 展开
1个回答
展开全部
<%
set rs = server.createobject("adodb.recordset")
sql="select * from Ameav_FriendSite order by id desc"
rs.open sql,conn,1,1
i=1
do while not rs.eof
if i mod 4=0 then response.write"</tr><tr>"
SiteFace=rs("SiteName")
response.write "<td class='text' align='center' valign='top'><a target='_blank' href='fengcai.asp?ID="&rs("id")&"' target='_blank' title=描述:"&rs("Remark")&"><img src='"&rs("SiteFace")&"' width='150' height='140' vspace='-10' hspace='10' style='border:2px solid #cccccc''></a>"&_
"<br><h3 class='ma'><a target='_blank' href='fengcai.asp?ID="&rs("id")&"'>"&rs("SiteName")&"</a></h3></td>"
rs.movenext
i=i+1
loop
rs.Close
set rs=nothing
%>
把i mod 5=0 改成 i mod 4=0 就可以了!还有什么不明白的HI我吧!
set rs = server.createobject("adodb.recordset")
sql="select * from Ameav_FriendSite order by id desc"
rs.open sql,conn,1,1
i=1
do while not rs.eof
if i mod 4=0 then response.write"</tr><tr>"
SiteFace=rs("SiteName")
response.write "<td class='text' align='center' valign='top'><a target='_blank' href='fengcai.asp?ID="&rs("id")&"' target='_blank' title=描述:"&rs("Remark")&"><img src='"&rs("SiteFace")&"' width='150' height='140' vspace='-10' hspace='10' style='border:2px solid #cccccc''></a>"&_
"<br><h3 class='ma'><a target='_blank' href='fengcai.asp?ID="&rs("id")&"'>"&rs("SiteName")&"</a></h3></td>"
rs.movenext
i=i+1
loop
rs.Close
set rs=nothing
%>
把i mod 5=0 改成 i mod 4=0 就可以了!还有什么不明白的HI我吧!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询