asp图片 最后一张对不齐 求正解

aibcc 2009-11-12 11:23:27
asp图片 最后一张对不齐前面的4张 程序如下...请问是为什么?如何修改??


<!--#include file="conn.asp"-->
<%
dim rs
dim sql
msg_per_page = 20
set rs = server.createobject("adodb.recordset")
sql="select * from photo order by time DESC"
rs.cursorlocation = 3

rs.pagesize = msg_per_page
rs.open sql,conn,0,1
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style3 {font-size: 1pt;
color: #FFFFFF;
}
.ziti {font-family: "宋体";
font-size: 12px;
font-weight: normal;
color: #FFFFFF;
}
.ziti1 {font-size: 12px;
font-weight: normal;
color: #000000;
}
.ziti2 {font-family: "宋体";
font-size: 12px;
font-weight: normal;
color: #FFFFFF;
}
.ziti2 { font-family: "宋体";
font-size: 12px;
font-weight: normal;
color: #000000;
}
.ziti3 {
font-family: "宋体";
font-size: 14px;
font-weight: normal;
color: #000000;
}
-->
</style>


<title>中特油墨图片展示</title>
</head>

<body>
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="900" height="227" align="center" valign="top" class="style3"><table border="0" style="border-collapse: collapse" bordercolor="#FFFFFF" width="100%" cellspacing="1">
<tr>
<td><p align="left"> </td>
</tr>
<%
if err.number<>0 then
response.write "数据库操作失败:" & err.description
err.clear
else
if not (rs.eof and rs.bof) then
totalrec = RS.RecordCount
if rs.recordcount mod msg_per_page = 0 then
n = rs.recordcount\msg_per_page
else
n = rs.recordcount\msg_per_page+1
end if

currentpage = request("page")
If currentpage <> "" then
currentpage = cint(currentpage)
if currentpage < 1 then
currentpage = 1
end if
if err.number <> 0 then
err.clear
currentpage = 1
end if
else
currentpage = 1
End if
if currentpage*msg_per_page > totalrec and not((currentpage-1)*msg_per_page < totalrec)then
currentPage=1
end if
rs.absolutepage = currentpage
rowcount = rs.pagesize
%>
<%
dim r
dim j
dim k
r=0
while not rs.eof and rowcount > 0
if r mod 5=0 then
row="<tr>"
else
row=" "
end if
r=r+1
response.write(row)
response.write("<td width=100 class=ziti2 align=center>" & "<a target=_blank href=photoview.asp?id=" & rs("id") & "><img width=150 height=100 border=0 src=uploadimg/" & rs("url") & "></a><p>")
response.write(rs("name") &"<br>")
rowcount=rowcount-1
rs.MoveNext
wend
end if
end if
rs.close
set rs=nothing

%>
</table></td>
</tr>
<tr>
<td height="20" class="ziti1"><table border="0" align="center">
<tr>
<td align="center" valign="middle" class="ziti1"><%call listPages()%></td>
</tr>
</table>
<%
sub listPages()
for i=0 to n\msg_per_page-1
for j=1 to msg_per_page
%>
<b> <a href="<%=request.ServerVariables("script_name")%>?page=<%=i*msg_per_page+j %>"> <font color="#000000" class="ziti1">[
<% =i*msg_per_page+j %>
]</font></a></b></font>  
<%
next
next
EndPage = n mod msg_per_page
for j=1 to EndPage
%>
<b> <a href="<%=request.ServerVariables("script_name")%>?page=<% =i*msg_per_page+j %>"> <font color="#000000" class="ziti1">[
<% =i*msg_per_page+j %>
]</font></a></b>
<%next%>
<br>
<b> <font size="2" class="ziti1">当前页:<%=currentpage%>/<%=n%>总页数   <%=msg_per_page%>张产品图片/页   总照片数:<%=totalrec%>张</font></b><font size="2">
<%end sub%>
</font></td>
</tr>
</table>
</body>
</html>
...全文
22 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

28,406

社区成员

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

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