想一行多列就不能循环输出单元行,而只能循环输出单元格.以1行3列为例,则满3此循环后就输出"
"代码另起一行。如<%if k mod 3 =0 then %>
<%end if%> - 如果K是3的倍数则输出
(如果不用表格则输出
换行就行)
部分代码如下
|
<% Do While Not Rs.Eof %>
<%=rs("gg_title")%> |
<%if k mod 3 =0 then %>
<%end if%>
<%rs.movenext
k=k+1
if k>Pagesize then exit do'写出列表
Loop
%>
全部代码
<%
Page = Trim(Request.QueryString("Page"))
k=1
if Page = "" or Page < "1" then
Page = "1"
end if
Sql = "Select * from QQ_gonggao3 order by id desc"
Rs.Open Sql,Conn,1,1
If Not(Rs.Eof And Rs.Bof) Then
if request("page")="" then
ThisPage=1
else
ThisPage=request("page")
end if
rs.Pagesize=6'此处为现实页面列表的数 50为每页显示50条数据
Pagesize=rs.Pagesize
Allrecord=rs.Recordcount
Allpage=rs.Pagecount
if ThisPage<1 then
ThisPage=1
end if
On Error Resume Next
rs.move (ThisPage-1)*Pagesize
%>
|
<% Do While Not Rs.Eof %>
<%=rs("gg_title")%> |
<%if k mod 3 =0 then %>
<%end if%>
<%
rs.movenext
k=k+1
if k>Pagesize then exit do'写出列表
Loop
%>
<%'下面为现实列表代码 if ThisPage<2 then response.write "首页 " response.write "上一页 " else response.write "首页 " response.write "上一页 " end if if Allpage-ThisPage<1 then response.write "下一页 " response.write "尾页 " else response.write "下一页 " response.write "尾页 " end if %> |
<%Else%>
暂无文章 |
<%End If
Rs.Close
%>