帮忙看下这段ASP代码怎么实现换行!谢谢!
我想把它改成每行显示5个图,超过5个就换下一行.不限制行数,就是有再多图都在一页,我折腾了很久还是没弄对.请复制以下代码修改,谢谢了!<tr><%rs1.open"sel...
我想把它改成每行显示5个图,超过5个就换下一行.
不限制行数,就是有再多图都在一页,我折腾了很久还是没弄对.
请复制以下代码修改,谢谢了!
<tr>
<%
rs1.open "select top 5 * from cpb where lb="&rs("id")&" order by rq desc",Mconn,1,1
if rs.eof=false then
for l=1 to rs1.recordcount
%>
<td align=center height=190 align=center style="cursor:pointer;line-height:190%;<%if l>1 then%>border-left:1px solid #cccccc<%end if%>" onmouseover="javascript:this.style.backgroundColor='#FFFFC7'" onmouseout="javascript:this.style.backgroundColor=''">
<img src=upimg/<%=rs1("tp")%> width=120 height=80 style="margin-bottom:10px"><br><%=rs1("mc")%><br><%=rs1("jg")%><br><a href="product_view.asp?id=<%=rs1("id")%>" target="_blank"><img src=images/so1.gif style="margin-top:10px"></a> <a href="product_view.asp?id=<%=rs1("id")%>" target="_blank"><img src=images/so2.gif style="margin-top:10px"></a>
</td>
<%
rs1.movenext
next
end if
rs1.close
%>
</tr>
阳光上的桥:现实这里 if (i-1 mod 5)=0 then response.write "<tr>" 语法错误!
6869502:能正常显示,但是成了1树列显示了.就是每行只有1个. 展开
不限制行数,就是有再多图都在一页,我折腾了很久还是没弄对.
请复制以下代码修改,谢谢了!
<tr>
<%
rs1.open "select top 5 * from cpb where lb="&rs("id")&" order by rq desc",Mconn,1,1
if rs.eof=false then
for l=1 to rs1.recordcount
%>
<td align=center height=190 align=center style="cursor:pointer;line-height:190%;<%if l>1 then%>border-left:1px solid #cccccc<%end if%>" onmouseover="javascript:this.style.backgroundColor='#FFFFC7'" onmouseout="javascript:this.style.backgroundColor=''">
<img src=upimg/<%=rs1("tp")%> width=120 height=80 style="margin-bottom:10px"><br><%=rs1("mc")%><br><%=rs1("jg")%><br><a href="product_view.asp?id=<%=rs1("id")%>" target="_blank"><img src=images/so1.gif style="margin-top:10px"></a> <a href="product_view.asp?id=<%=rs1("id")%>" target="_blank"><img src=images/so2.gif style="margin-top:10px"></a>
</td>
<%
rs1.movenext
next
end if
rs1.close
%>
</tr>
阳光上的桥:现实这里 if (i-1 mod 5)=0 then response.write "<tr>" 语法错误!
6869502:能正常显示,但是成了1树列显示了.就是每行只有1个. 展开
2个回答
展开全部
试试看下面的代码:
<%
rs1.open "select top 5 * from cpb where lb="&rs("id")&" order by rq desc",Mconn,1,1
if rs.eof=false then
for l=1 to rs1.recordcount
if (i-1 mod 5)=0 then response.write "<tr>"
%>
<td align=center height=190 align=center style="cursor:pointer;line-height:190%;<%if l>1 then%>border-left:1px solid #cccccc<%end if%>" onmouseover="javascript:this.style.backgroundColor='#FFFFC7'" onmouseout="javascript:this.style.backgroundColor=''">
<img src=upimg/<%=rs1("tp")%> width=120 height=80 style="margin-bottom:10px"><br><%=rs1("mc")%><br><%=rs1("jg")%><br><a href="product_view.asp?id=<%=rs1("id")%>" target="_blank"><img src=images/so1.gif style="margin-top:10px"></a> <a href="product_view.asp?id=<%=rs1("id")%>" target="_blank"><img src=images/so2.gif style="margin-top:10px"></a>
</td>
<%
rs1.movenext
next
end if
rs1.close
%>
补充:
为什么不粘贴错误提示?考我吗~
<%
rs1.open "select top 5 * from cpb where lb="&rs("id")&" order by rq desc",Mconn,1,1
if rs.eof=false then
for l=1 to rs1.recordcount
if (i-1 mod 5)=0 then response.write "<tr>"
%>
<td align=center height=190 align=center style="cursor:pointer;line-height:190%;<%if l>1 then%>border-left:1px solid #cccccc<%end if%>" onmouseover="javascript:this.style.backgroundColor='#FFFFC7'" onmouseout="javascript:this.style.backgroundColor=''">
<img src=upimg/<%=rs1("tp")%> width=120 height=80 style="margin-bottom:10px"><br><%=rs1("mc")%><br><%=rs1("jg")%><br><a href="product_view.asp?id=<%=rs1("id")%>" target="_blank"><img src=images/so1.gif style="margin-top:10px"></a> <a href="product_view.asp?id=<%=rs1("id")%>" target="_blank"><img src=images/so2.gif style="margin-top:10px"></a>
</td>
<%
rs1.movenext
next
end if
rs1.close
%>
补充:
为什么不粘贴错误提示?考我吗~
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询