想把这段代码改成分页显示
调用18个产品每页显示9个分两页显示<tablewidth="100%"border="0"cellspacing="0"cellpadding="0"align="ce...
调用 18个产品 每页显示9个 分两页显示
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<%set rs=server.createobject("adodb.recordset")
sql="select top 9 * from SMT_cp where SMT_key=1 and SMT_key1=1 and SMT_key2=1 and SMT_key3=0 order by SMT_id desc"
rs.open sql,conn,1,1
n=0
do while not rs.eof
n=n+1
cpname=rs("SMT_cpname")%>
<td valign=top>
<table width="160" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="center" height=90>
<table width="120" height="120" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><a href=cp_view.asp?id=<%=rs("SMT_id")%> target="_blank"><img src="<%=rs("SMT_pic")%>" border="0" width=100 height=100></a></div></td>
</tr>
</table></td>
</tr>
<tr>
<td height=60 align="center" valign="top" background="img/mmm.jpg" style="border-bottom:1px #cccccc solid"><table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td><div align="center" style="color: #C53333"><strong>数码城价格:<%=LeftT(rs("SMT_cpjg"),10)%> 元</strong></div></td>
</tr>
<tr>
<td><div align="center">
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><a href=cp_view.asp?id=<%=rs("SMT_id")%> target="_blank"><%=LeftT(cpname,44)%></a> </div></td>
</tr>
</table>
</div></td>
</tr>
</table> </td>
</tr>
</table></td>
<%if n mod 3=0 and n<>15 then response.write"</tr><tr bgcolor=#ffffff>"
rs.movenext
loop
rs.close%>
</tr>
</table> 展开
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<%set rs=server.createobject("adodb.recordset")
sql="select top 9 * from SMT_cp where SMT_key=1 and SMT_key1=1 and SMT_key2=1 and SMT_key3=0 order by SMT_id desc"
rs.open sql,conn,1,1
n=0
do while not rs.eof
n=n+1
cpname=rs("SMT_cpname")%>
<td valign=top>
<table width="160" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="center" height=90>
<table width="120" height="120" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><a href=cp_view.asp?id=<%=rs("SMT_id")%> target="_blank"><img src="<%=rs("SMT_pic")%>" border="0" width=100 height=100></a></div></td>
</tr>
</table></td>
</tr>
<tr>
<td height=60 align="center" valign="top" background="img/mmm.jpg" style="border-bottom:1px #cccccc solid"><table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td><div align="center" style="color: #C53333"><strong>数码城价格:<%=LeftT(rs("SMT_cpjg"),10)%> 元</strong></div></td>
</tr>
<tr>
<td><div align="center">
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><a href=cp_view.asp?id=<%=rs("SMT_id")%> target="_blank"><%=LeftT(cpname,44)%></a> </div></td>
</tr>
</table>
</div></td>
</tr>
</table> </td>
</tr>
</table></td>
<%if n mod 3=0 and n<>15 then response.write"</tr><tr bgcolor=#ffffff>"
rs.movenext
loop
rs.close%>
</tr>
</table> 展开
1个回答
展开全部
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<%
page = request("page")
if isNull(page) or page = "" then page = 1
if not isnumeric(page) then page = 1
if page < 1 then page = 1
set rs=server.createobject("adodb.recordset")
sql="select top " & (9 * page) & " * from SMT_cp where SMT_key=1 and SMT_key1=1 and SMT_key2=1 and SMT_key3=0 order by SMT_id desc"
rs.open sql,conn,1,1
iCnt = 0
n=0
do while not rs.eof
n=n+1
iCnt = iCnt + 1
if icnt > (page-1) * 9 then
cpname=rs("SMT_cpname")%>
<td valign=top>
<table width="160" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="center" height=90>
<table width="120" height="120" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><a href=cp_view.asp?id=<%=rs("SMT_id")%> target="_blank"><img src="<%=rs("SMT_pic")%>" border="0" width=100 height=100></a></div></td>
</tr>
</table></td>
</tr>
<tr>
<td height=60 align="center" valign="top" background="img/mmm.jpg" style="border-bottom:1px #cccccc solid"><table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td><div align="center" style="color: #C53333"><strong>数码城价格:<%=LeftT(rs("SMT_cpjg"),10)%> 元</strong></div></td>
</tr>
<tr>
<td><div align="center">
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><a href=cp_view.asp?id=<%=rs("SMT_id")%> target="_blank"><%=LeftT(cpname,44)%></a> </div></td>
</tr>
</table>
</div></td>
</tr>
</table> </td>
</tr>
</table></td>
<%if n mod 3=0 and n<>15 then response.write"</tr><tr bgcolor=#ffffff>"
end if
rs.movenext
loop
rs.close%>
</tr>
<tr>
<td><a href="?page=<%=page-1%>">上一页</a> <a href="?page=<%=page+1%>">下一页</a></td>
</tr>
</table>
<tr>
<%
page = request("page")
if isNull(page) or page = "" then page = 1
if not isnumeric(page) then page = 1
if page < 1 then page = 1
set rs=server.createobject("adodb.recordset")
sql="select top " & (9 * page) & " * from SMT_cp where SMT_key=1 and SMT_key1=1 and SMT_key2=1 and SMT_key3=0 order by SMT_id desc"
rs.open sql,conn,1,1
iCnt = 0
n=0
do while not rs.eof
n=n+1
iCnt = iCnt + 1
if icnt > (page-1) * 9 then
cpname=rs("SMT_cpname")%>
<td valign=top>
<table width="160" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="center" height=90>
<table width="120" height="120" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><a href=cp_view.asp?id=<%=rs("SMT_id")%> target="_blank"><img src="<%=rs("SMT_pic")%>" border="0" width=100 height=100></a></div></td>
</tr>
</table></td>
</tr>
<tr>
<td height=60 align="center" valign="top" background="img/mmm.jpg" style="border-bottom:1px #cccccc solid"><table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td><div align="center" style="color: #C53333"><strong>数码城价格:<%=LeftT(rs("SMT_cpjg"),10)%> 元</strong></div></td>
</tr>
<tr>
<td><div align="center">
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><a href=cp_view.asp?id=<%=rs("SMT_id")%> target="_blank"><%=LeftT(cpname,44)%></a> </div></td>
</tr>
</table>
</div></td>
</tr>
</table> </td>
</tr>
</table></td>
<%if n mod 3=0 and n<>15 then response.write"</tr><tr bgcolor=#ffffff>"
end if
rs.movenext
loop
rs.close%>
</tr>
<tr>
<td><a href="?page=<%=page-1%>">上一页</a> <a href="?page=<%=page+1%>">下一页</a></td>
</tr>
</table>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询