ASP分页一列多行代码怎么改
<%@LANGUAGE="VBSCRIPT"CODEPAGE="936"%><!--#includefile="conn.asp"--><head><metahttp-e...
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<table width="700" border="1" cellspacing="0" cellpadding="0">
<%
sql="select * from [table] order by time1 desc"
rs.open sql,conn,1,1
if rs.eof then
else
rs.pagesize=4
page=clng(Request("page"))
if page<1 then page=1
if page>rs.pagecount then page=rs.pagecount
rs.AbsolutePage = page
for i=1 to rs.pagesize
if i mod 2=1 then
%>
<tr>
<%
end if
%>
<td height="100" align="center"><img src="<%=rs("pic")%>" /></td>
<%
if i mod 2=0 then
%>
</tr>
<%
end if
%>
<%
rs.movenext
If rs.EOF Then
Exit For
End If
Next
end if
'rs.close
%>
<!--#include file="page.asp"-->
<form name="form1" method="post" action="">
<tr>
<td colspan="2"><%
call fpage("")
%></td>
</tr>
</form>
</table>
</body>
</html>
要一列5行 说清楚点 我可是超级菜鸟
对不起 说错 是一行5列.... 展开
<!--#include file="conn.asp"-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<table width="700" border="1" cellspacing="0" cellpadding="0">
<%
sql="select * from [table] order by time1 desc"
rs.open sql,conn,1,1
if rs.eof then
else
rs.pagesize=4
page=clng(Request("page"))
if page<1 then page=1
if page>rs.pagecount then page=rs.pagecount
rs.AbsolutePage = page
for i=1 to rs.pagesize
if i mod 2=1 then
%>
<tr>
<%
end if
%>
<td height="100" align="center"><img src="<%=rs("pic")%>" /></td>
<%
if i mod 2=0 then
%>
</tr>
<%
end if
%>
<%
rs.movenext
If rs.EOF Then
Exit For
End If
Next
end if
'rs.close
%>
<!--#include file="page.asp"-->
<form name="form1" method="post" action="">
<tr>
<td colspan="2"><%
call fpage("")
%></td>
</tr>
</form>
</table>
</body>
</html>
要一列5行 说清楚点 我可是超级菜鸟
对不起 说错 是一行5列.... 展开
3个回答
展开全部
<table width="100%" >
<tr>
<%pagesizes = 10
pics_per_line=5
sql="SELECT top "&pagesizes&" * FROM [table] order by time1 desc"
i=0
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,0,1
while rs.eof=false and rs.bof=false
i=i+1
%>
<td> 内容</td>
<%
rs.movenext
'此行输出pics_per_line个后就新换一行
if (i<pagesizes)and(i mod pics_per_line=0) then%></tr>
<tr>
<%
end if
wend
rs.close()
%>
</tr></table>
<tr>
<%pagesizes = 10
pics_per_line=5
sql="SELECT top "&pagesizes&" * FROM [table] order by time1 desc"
i=0
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,0,1
while rs.eof=false and rs.bof=false
i=i+1
%>
<td> 内容</td>
<%
rs.movenext
'此行输出pics_per_line个后就新换一行
if (i<pagesizes)and(i mod pics_per_line=0) then%></tr>
<tr>
<%
end if
wend
rs.close()
%>
</tr></table>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询