asp如何控制图片的横向排列,而且保持分页功能不变 10
<tablewidth="667"border="0"align="center"cellpadding="5"cellspacing="3"bgcolor="#9FCA...
<table width="667" border="0" align="center" cellpadding="5" cellspacing="3" bgcolor="#9FCA59">
<%
id=request.querystring("id")
set rs=server.createobject("adodb.recordset")
sql="select * from cp where classid="&id&" order by data desc"
rs.open sql,conn,1,1
dim ddd:ddd=0
if rs.eof and rs.bof then
response.write "暂无产品"
else
'分页的实现
listnum=18
Rs.pagesize=listnum
page=Request("page")
if (page-Rs.pagecount) > 0 then
page=Rs.pagecount
elseif page = "" or page < 1 then
page = 1
end if
Rs.absolutepage=page
'编号的实现
j=rs.recordcount
j=j-(page-1)*listnum
i=0
nn=request("page")
if nn="" then
n=0
else
nn=nn-1
n=listnum*nn
end if
do while not rs.eof and i<listnum
%>
<tr>
<td height="25" colspan="2" bgcolor="ffffff" <%if ddd mod 2 =0 then%><%else%>bgcolor="#D1E6AE"<%end if%>><strong><a href="pic/<%=rs("pic")%>" target="_blank"></a><a href="pro.asp?id=<%=rs("id")%>"></a></strong>
<table width="110" height="100" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100" height="100"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="90" height="90" class="bbbb"><div align="center"><a href="pro.asp?id=<%=rs("id")%>"></a><strong><a href="pic/<%=rs("pic")%>" target="_blank"><img src="pic/<%=rs("pic")%>"alt="<%=rs("title")%>" name="" width="120" height="120" border="0"></a></strong></div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="26">
<div align="center"><a href="pro.asp?id=<%=rs("id")%>"><%=rs("title")%></a></div></td>
</tr>
</table>
</td>
</tr><%rs.movenext
i=i+1
j=j-1
ddd=ddd+1
loop
%>
</table>
<table width="667" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><%filename="?id="&request("id")&""%>
<td colspan=12 height=30 align=right>共<%=Rs.recordcount%> 产品 共 <%=Rs.pagecount%> 页
<% if page=1 then %>
<%else%>
<a href=<%=filename%>>首页</a> <a href=<%=filename%>&page=<%=page-1%>>上一页</a> <a href=<%=filename%>&page=<%=page-1%>><%=page-1%></a>
<%end if%>
<% if Rs.pagecount=1 then %>
<%else%>
<font color="#FF0000"><%=page%>
<%end if%>
<% if Rs.pagecount-page <> 0 then %>
<a href=<%=filename%>&page=<%=page+1%>><%=page+1%></a> <a href=<%=filename%>&page=<%=page+1%>>下一页</a> <a href=<%=filename%>&page=<%=Rs.pagecount%>>尾页</a>
<%end if end if%></td>
</tr>
</table></td>
</tr>
</table> 展开
<%
id=request.querystring("id")
set rs=server.createobject("adodb.recordset")
sql="select * from cp where classid="&id&" order by data desc"
rs.open sql,conn,1,1
dim ddd:ddd=0
if rs.eof and rs.bof then
response.write "暂无产品"
else
'分页的实现
listnum=18
Rs.pagesize=listnum
page=Request("page")
if (page-Rs.pagecount) > 0 then
page=Rs.pagecount
elseif page = "" or page < 1 then
page = 1
end if
Rs.absolutepage=page
'编号的实现
j=rs.recordcount
j=j-(page-1)*listnum
i=0
nn=request("page")
if nn="" then
n=0
else
nn=nn-1
n=listnum*nn
end if
do while not rs.eof and i<listnum
%>
<tr>
<td height="25" colspan="2" bgcolor="ffffff" <%if ddd mod 2 =0 then%><%else%>bgcolor="#D1E6AE"<%end if%>><strong><a href="pic/<%=rs("pic")%>" target="_blank"></a><a href="pro.asp?id=<%=rs("id")%>"></a></strong>
<table width="110" height="100" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100" height="100"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="90" height="90" class="bbbb"><div align="center"><a href="pro.asp?id=<%=rs("id")%>"></a><strong><a href="pic/<%=rs("pic")%>" target="_blank"><img src="pic/<%=rs("pic")%>"alt="<%=rs("title")%>" name="" width="120" height="120" border="0"></a></strong></div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="26">
<div align="center"><a href="pro.asp?id=<%=rs("id")%>"><%=rs("title")%></a></div></td>
</tr>
</table>
</td>
</tr><%rs.movenext
i=i+1
j=j-1
ddd=ddd+1
loop
%>
</table>
<table width="667" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><%filename="?id="&request("id")&""%>
<td colspan=12 height=30 align=right>共<%=Rs.recordcount%> 产品 共 <%=Rs.pagecount%> 页
<% if page=1 then %>
<%else%>
<a href=<%=filename%>>首页</a> <a href=<%=filename%>&page=<%=page-1%>>上一页</a> <a href=<%=filename%>&page=<%=page-1%>><%=page-1%></a>
<%end if%>
<% if Rs.pagecount=1 then %>
<%else%>
<font color="#FF0000"><%=page%>
<%end if%>
<% if Rs.pagecount-page <> 0 then %>
<a href=<%=filename%>&page=<%=page+1%>><%=page+1%></a> <a href=<%=filename%>&page=<%=page+1%>>下一页</a> <a href=<%=filename%>&page=<%=Rs.pagecount%>>尾页</a>
<%end if end if%></td>
</tr>
</table></td>
</tr>
</table> 展开
1个回答
展开全部
呵呵 你的代码太长了 我看的头都大了
我给你个例子:
希望对你有帮助
<table width="100%" border="0" cellspacing="0" cellpadding="10" align="center">
<tr>
<%
for i=1 to 10
if i mod 5=0 then
response.write"<td><table border='1'><tr>"
response.write"<td>"& i &"</td></tr></table></td>"
response.write"</tr><tr>"
else
response.write"<td><table border='1'><tr><td>"& i &"</td></tr></table></td>"
end if
next
%>
</tr>
</table>
呵呵 希望早日搞定啊!
我给你个例子:
希望对你有帮助
<table width="100%" border="0" cellspacing="0" cellpadding="10" align="center">
<tr>
<%
for i=1 to 10
if i mod 5=0 then
response.write"<td><table border='1'><tr>"
response.write"<td>"& i &"</td></tr></table></td>"
response.write"</tr><tr>"
else
response.write"<td><table border='1'><tr><td>"& i &"</td></tr></table></td>"
end if
next
%>
</tr>
</table>
呵呵 希望早日搞定啊!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询