分页代码修改

xiaosolovepig 2009-11-07 02:56:39
<!--产品循环开始-->
<div align="center">
<%
ses=" where admin=2"
if request("wd")<>"" then
ses=ses & " and type1='"&request("wd")&"'"
end if
set rs=server.createobject("adodb.recordset")
sql="select * from pro "&ses&" order by sj desc"
rs.open sql,conn,1,3

if rs.eof then
else
rs.pagesize=12
page=request("page")
if page<>"" then
page=clng(request("page"))
if page<1 then
page=1
end if
else
page=1
end if


if page>rs.pagecount then
page=rs.pagecount
end if
rs.AbsolutePage = page

for j=1 to rs.pagesize/4
%>
<table border="0" cellspacing="0" cellpadding="0" id="table1" class="font0" style="margin-top:18" height="77">
<tr>
<%
for i=1 to 4
%>
<td width="160" align="center" valign="top" class="pad5">
<table width="222" border="0" cellpadding="0" cellspacing="0" class="font1" id="table2">
<tr>
<td height="25" align="center"><a href="proindex.asp?id=<%=rs("id")%>" target=_blank>
<img src="site_manage/loveedit/uploadfile/<%=rs("tp")%>" width="223" height="169" border="0"style="border-left: 1px solid #DDDDDD; border-right: 1px solid #DDDDDD; border-top: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD"></a></td>
</tr> <tr>
<td align="center" class="pad9"><a href="proindex.asp?id=<%=rs("id")%>" class="anone" target=_blank>
<p style="margin-top: 3px"> <%=mid(rs("tit"),1,20)%></a> </td>
</tr>
</table>
</td>
<%
rs.movenext
if rs.eof then exit for
next
%>
</tr>
</table>
<%
if rs.eof then exit for
next

end if
%>
</div>


<!--分页-->
<%
nowdomain="products.asp"
nowlast="wd="&escape(request("wd"))
%>
<!--#include file="page.html"-->
<!--分页-->
<!--产品循环结束-->


这个是循环产品的代码
我想变成每行3张图片
一共三行
也就是九张
请问如何修改?

...全文
91 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
lzp4881 2009-11-07
  • 打赏
  • 举报
回复
<div align="center">
<%
ses=" where admin=2"
if request("wd") <>"" then
ses=ses & " and type1='"&request("wd")&"'"
end if
set rs=server.createobject("adodb.recordset")
sql="select * from pro "&ses&" order by sj desc"
rs.open sql,conn,1,3

if rs.eof then
else
rs.pagesize=9
page=request("page")
if page <>"" then
page=clng(request("page"))
if page <1 then
page=1
end if
else
page=1
end if


if page>rs.pagecount then
page=rs.pagecount
end if
rs.AbsolutePage = page

for j=1 to rs.pagesize/3
%>
<table border="0" cellspacing="0" cellpadding="0" id="table1" class="font0" style="margin-top:18" height="77">
<tr>
<%
for i=1 to 3
%>
<td width="160" align="center" valign="top" class="pad5">
<table width="222" border="0" cellpadding="0" cellspacing="0" class="font1" id="table2">
<tr>
<td height="25" align="center"> <a href="proindex.asp?id= <%=rs("id")%>" target=_blank>
<img src="site_manage/loveedit/uploadfile/ <%=rs("tp")%>" width="223" height="169" border="0"style="border-left: 1px solid #DDDDDD; border-right: 1px solid #DDDDDD; border-top: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD"> </a> </td>
</tr> <tr>
<td align="center" class="pad9"> <a href="proindex.asp?id= <%=rs("id")%>" class="anone" target=_blank>
<p style="margin-top: 3px">  <%=mid(rs("tit"),1,20)%> </a>  </td>
</tr>
</table>
</td>
<%
rs.movenext
if rs.eof then exit for
next
%>
</tr>
</table>
<%
if rs.eof then exit for
next

end if
%>
</div>
hbwanghaihui 2009-11-07
  • 打赏
  • 举报
回复
感觉按照1楼的方法就可以了~~
  • 打赏
  • 举报
回复
你上面这个不是
12张的吗?
你把12改为9,把4改为3不就可以了?

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧