ASp调出AEECSS数据库内的图片,假如每页显示30张,每列3张,共10行,纵向排列和 和分页 ,怎么弄?
ASp调出AEECSS数据库内的图片,假如每页显示30张,每列3张,共10行,其他内容从第二页开始分页显示,纵向排列和分页,怎么弄?...
ASp调出AEECSS数据库内的图片,假如每页显示30张,每列3张,共10行,其他内容从第二页开始分页显示,纵向排列 和分页 ,怎么弄?
展开
展开全部
我可以上传一段正在运营当中的网站的分页代码,这个是www.qyyq.cc网址,你可以看下,我上传的是进入这个网站“七彩真石”栏目下的分页代码。
其实思路不是很麻烦:最外层是一个一行一列的大的table,在<td></td>中利用div的 float:left 样式来控制 让 div 横向排列 具体横向排列几个可以控制div的宽度来调节,我这里是横向排列4列。具体代码如下:
<!--#include file="Inc/TemplateConnection1.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
.company_right{float:right;width:598px; background:url(../Images/l_12.jpg) no-repeat top;}
.company_word{margin:30px 30px 20px 0px; color:#d7aa71; line-height:150%; letter-spacing:1px;}
.good_img{ width:124px; height:83px; border:1px solid #5e4833; text-align:left; padding:2px;}
.good_div1{float:left; margin-left:13px;_margin-left:8px; width:128px; height:145px; text-align:left;}
</style>
</head>
<body>
<div class="company_right">
<div class="company_word">
<table border="0" cellpadding="0" style="width:100%;">
<tr>
<td style="width:100%;">
<%
Set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from 表名"
rs.open sql,conn,1,1
if rs.bof and rs.eof then
response.Write("<div style='width:100%;line-height:380px;text-align:center;color:#FF0000;'>暂无产品信息</div>")
else
rs.PageSize = 24
rs.CursorLocation = 3
rs.Open sql,conn,0,2,1
pre = true
last = true
page = trim(Request.QueryString("page"))
if len(page) = 0 then
intpage = 1
pre = false
else
if cint(page) =< 1 then
intpage = 1
pre = false
else
if cint(page) >= rs.PageCount then
intpage = rs.PageCount
last = false
else
intpage = cint(page)
end if
end if
end if
if not rs.eof then
rs.AbsolutePage = intpage
end if
for i=1 to rs.PageSize
if rs.EOF or rs.BOF then exit for
%>
<div class="good_div1">
<div class="good_img">
<a href="url"><img src="<%= rs("ProductImageSrc")%>" width="124" height="83" /></a>
</div>
<div class="good_title">
<table border="0" cellpadding="0" cellspacing="0" width="128"><tr><td>标题</td></tr>
</table>
</div>
</div>
<%
rs.movenext
next
%>
</td>
</tr>
<tr><td>
<div style="text-align:right; margin-right:15px;">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" align="right" style="height:35px; line-height:35px;">
<%if rs.pagecount > 0 then%>
当前页<font color="#FF0000"><%=intpage%></font>/<%=rs.PageCount%>
<%else%>
当前页0/0<%end if%> <font color="#FF0000"><%= rs.PageSize %></font>条记录/页
<a href="qczs.asp?page=1">首页</a>
<%if pre then%>
<a href="qczs.asp?page=<%=intpage -1%>">上页</a> <%end if%>
<%if last then%>
<a href="qczs.asp?page=<%=intpage +1%>">下页</a> <%end if%>
<a href="qczs.asp?page=<%=rs.PageCount%>">尾页</a> 转到第
<select name="sel_page" onchange="javascript:location=this.options[this.selectedIndex].value;">
<%
for i = 1 to rs.PageCount
if i = intpage then%>
<option value="qczs.asp?page=<%=i%>" selected><%=i%></option>
<%else%>
<option value="qczs.asp?page=<%=i%>"><%=i%></option>
<%
end if
next
%>
</select>页
</td>
</tr>
</table>
</div>
<%
end if
rs.close
set rs=nothing
%>
</td>
</tr>
</table>
</div>
</div>
</body>
</html>
你做适当的修改就可以了,希望我的回答能给你一些帮助
其实思路不是很麻烦:最外层是一个一行一列的大的table,在<td></td>中利用div的 float:left 样式来控制 让 div 横向排列 具体横向排列几个可以控制div的宽度来调节,我这里是横向排列4列。具体代码如下:
<!--#include file="Inc/TemplateConnection1.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
.company_right{float:right;width:598px; background:url(../Images/l_12.jpg) no-repeat top;}
.company_word{margin:30px 30px 20px 0px; color:#d7aa71; line-height:150%; letter-spacing:1px;}
.good_img{ width:124px; height:83px; border:1px solid #5e4833; text-align:left; padding:2px;}
.good_div1{float:left; margin-left:13px;_margin-left:8px; width:128px; height:145px; text-align:left;}
</style>
</head>
<body>
<div class="company_right">
<div class="company_word">
<table border="0" cellpadding="0" style="width:100%;">
<tr>
<td style="width:100%;">
<%
Set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from 表名"
rs.open sql,conn,1,1
if rs.bof and rs.eof then
response.Write("<div style='width:100%;line-height:380px;text-align:center;color:#FF0000;'>暂无产品信息</div>")
else
rs.PageSize = 24
rs.CursorLocation = 3
rs.Open sql,conn,0,2,1
pre = true
last = true
page = trim(Request.QueryString("page"))
if len(page) = 0 then
intpage = 1
pre = false
else
if cint(page) =< 1 then
intpage = 1
pre = false
else
if cint(page) >= rs.PageCount then
intpage = rs.PageCount
last = false
else
intpage = cint(page)
end if
end if
end if
if not rs.eof then
rs.AbsolutePage = intpage
end if
for i=1 to rs.PageSize
if rs.EOF or rs.BOF then exit for
%>
<div class="good_div1">
<div class="good_img">
<a href="url"><img src="<%= rs("ProductImageSrc")%>" width="124" height="83" /></a>
</div>
<div class="good_title">
<table border="0" cellpadding="0" cellspacing="0" width="128"><tr><td>标题</td></tr>
</table>
</div>
</div>
<%
rs.movenext
next
%>
</td>
</tr>
<tr><td>
<div style="text-align:right; margin-right:15px;">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" align="right" style="height:35px; line-height:35px;">
<%if rs.pagecount > 0 then%>
当前页<font color="#FF0000"><%=intpage%></font>/<%=rs.PageCount%>
<%else%>
当前页0/0<%end if%> <font color="#FF0000"><%= rs.PageSize %></font>条记录/页
<a href="qczs.asp?page=1">首页</a>
<%if pre then%>
<a href="qczs.asp?page=<%=intpage -1%>">上页</a> <%end if%>
<%if last then%>
<a href="qczs.asp?page=<%=intpage +1%>">下页</a> <%end if%>
<a href="qczs.asp?page=<%=rs.PageCount%>">尾页</a> 转到第
<select name="sel_page" onchange="javascript:location=this.options[this.selectedIndex].value;">
<%
for i = 1 to rs.PageCount
if i = intpage then%>
<option value="qczs.asp?page=<%=i%>" selected><%=i%></option>
<%else%>
<option value="qczs.asp?page=<%=i%>"><%=i%></option>
<%
end if
next
%>
</select>页
</td>
</tr>
</table>
</div>
<%
end if
rs.close
set rs=nothing
%>
</td>
</tr>
</table>
</div>
</div>
</body>
</html>
你做适当的修改就可以了,希望我的回答能给你一些帮助
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询