ASP 一行多列的问题,如下图请大家帮帮我怎么修改。请修改后将原代码全部粘贴上来
<%Page=Trim(Request.QueryString("Page"))k=1ifPage=""orPage<"1"thenPage="1"endifSql="S...
<%
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
%>
<tr bgcolor="#FFFFFF">
<td height="25" colspan="5" align="center" bgcolor="#FFFFFF" style="line-height:170%; font-size:14px;"><%=rs("gg_title")%></td> 就是调用这条参数将他分为一行三例
</tr>
<%
k=k+1
rs.movenext
if k>Pagesize then exit do'写出列表
Loop
%>
<tr bgcolor="#FFFFFF">
<td colspan="5" align="right" bgcolor="#F2F2F2" style="line-height:170%; font-size:14px;"><%'下面为现实列表代码
if ThisPage<2 then
response.write "<font color=""#808080"" style=font-size:12px>首页</font> "
response.write "<font color=""#808080"" style=font-size:12px>上一页</font> "
else
response.write "<a href=?page=1 style=font-size:12px >首页</a> "
response.write "<a href=?page="&ThisPage-1&" style=font-size:12px>上一页</a> "
end if
if Allpage-ThisPage<1 then
response.write "<font color=""#808080"" style=font-size:12px>下一页</font> "
response.write "<font color=""#808080"" style=font-size:12px>尾页</font> "
else
response.write "<a href=?page="&(ThisPage+1)&" style=font-size:12px>下一页</a> "
response.write "<a href=?page="&Allpage&" style=font-size:12px>尾页</a> "
end if
%> </td>
</tr>
<%Else%>
<tr bgcolor="#FFFFFF">
<td colspan="5" align="center">暂无文章</td>
</tr>
<%End If
Rs.Close
%> 展开
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
%>
<tr bgcolor="#FFFFFF">
<td height="25" colspan="5" align="center" bgcolor="#FFFFFF" style="line-height:170%; font-size:14px;"><%=rs("gg_title")%></td> 就是调用这条参数将他分为一行三例
</tr>
<%
k=k+1
rs.movenext
if k>Pagesize then exit do'写出列表
Loop
%>
<tr bgcolor="#FFFFFF">
<td colspan="5" align="right" bgcolor="#F2F2F2" style="line-height:170%; font-size:14px;"><%'下面为现实列表代码
if ThisPage<2 then
response.write "<font color=""#808080"" style=font-size:12px>首页</font> "
response.write "<font color=""#808080"" style=font-size:12px>上一页</font> "
else
response.write "<a href=?page=1 style=font-size:12px >首页</a> "
response.write "<a href=?page="&ThisPage-1&" style=font-size:12px>上一页</a> "
end if
if Allpage-ThisPage<1 then
response.write "<font color=""#808080"" style=font-size:12px>下一页</font> "
response.write "<font color=""#808080"" style=font-size:12px>尾页</font> "
else
response.write "<a href=?page="&(ThisPage+1)&" style=font-size:12px>下一页</a> "
response.write "<a href=?page="&Allpage&" style=font-size:12px>尾页</a> "
end if
%> </td>
</tr>
<%Else%>
<tr bgcolor="#FFFFFF">
<td colspan="5" align="center">暂无文章</td>
</tr>
<%End If
Rs.Close
%> 展开
展开全部
想一行多列就不能循环输出单元行,而只能循环输出单元格.以1行3列为例,则满3此循环后就输出"</tr><tr>"代码另起一行。如<%if k mod 3 =0 then %></tr><tr><%end if%> - 如果K是3的倍数则输出</tr><tr>
(如果不用表格则输出<br />换行就行)
部分代码如下
<tr bgcolor="#FFFFFF">
<% Do While Not Rs.Eof %>
<td height="25" colspan="5" align="center" bgcolor="#FFFFFF" style="line-height:170%; font-size:14px;"><%=rs("gg_title")%></td>
<%if k mod 3 =0 then %>
</tr><tr>
<%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
%>
<tr bgcolor="#FFFFFF">
<% Do While Not Rs.Eof %>
<td height="25" colspan="5" align="center" bgcolor="#FFFFFF" style="line-height:170%; font-size:14px;"><%=rs("gg_title")%></td>
<%if k mod 3 =0 then %>
</tr><tr>
<%end if%>
<%
rs.movenext
k=k+1
if k>Pagesize then exit do'写出列表
Loop
%>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="5" align="right" bgcolor="#F2F2F2" style="line-height:170%; font-size:14px;"><%'下面为现实列表代码
if ThisPage<2 then
response.write "<font color=""#808080"" style=font-size:12px>首页</font> "
response.write "<font color=""#808080"" style=font-size:12px>上一页</font> "
else
response.write "<a href=?page=1 style=font-size:12px >首页</a> "
response.write "<a href=?page="&ThisPage-1&" style=font-size:12px>上一页</a> "
end if
if Allpage-ThisPage<1 then
response.write "<font color=""#808080"" style=font-size:12px>下一页</font> "
response.write "<font color=""#808080"" style=font-size:12px>尾页</font> "
else
response.write "<a href=?page="&(ThisPage+1)&" style=font-size:12px>下一页</a> "
response.write "<a href=?page="&Allpage&" style=font-size:12px>尾页</a> "
end if
%> </td>
</tr>
<%Else%>
<tr bgcolor="#FFFFFF">
<td colspan="5" align="center">暂无文章</td>
</tr>
<%End If
Rs.Close
%>
(如果不用表格则输出<br />换行就行)
部分代码如下
<tr bgcolor="#FFFFFF">
<% Do While Not Rs.Eof %>
<td height="25" colspan="5" align="center" bgcolor="#FFFFFF" style="line-height:170%; font-size:14px;"><%=rs("gg_title")%></td>
<%if k mod 3 =0 then %>
</tr><tr>
<%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
%>
<tr bgcolor="#FFFFFF">
<% Do While Not Rs.Eof %>
<td height="25" colspan="5" align="center" bgcolor="#FFFFFF" style="line-height:170%; font-size:14px;"><%=rs("gg_title")%></td>
<%if k mod 3 =0 then %>
</tr><tr>
<%end if%>
<%
rs.movenext
k=k+1
if k>Pagesize then exit do'写出列表
Loop
%>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="5" align="right" bgcolor="#F2F2F2" style="line-height:170%; font-size:14px;"><%'下面为现实列表代码
if ThisPage<2 then
response.write "<font color=""#808080"" style=font-size:12px>首页</font> "
response.write "<font color=""#808080"" style=font-size:12px>上一页</font> "
else
response.write "<a href=?page=1 style=font-size:12px >首页</a> "
response.write "<a href=?page="&ThisPage-1&" style=font-size:12px>上一页</a> "
end if
if Allpage-ThisPage<1 then
response.write "<font color=""#808080"" style=font-size:12px>下一页</font> "
response.write "<font color=""#808080"" style=font-size:12px>尾页</font> "
else
response.write "<a href=?page="&(ThisPage+1)&" style=font-size:12px>下一页</a> "
response.write "<a href=?page="&Allpage&" style=font-size:12px>尾页</a> "
end if
%> </td>
</tr>
<%Else%>
<tr bgcolor="#FFFFFF">
<td colspan="5" align="center">暂无文章</td>
</tr>
<%End If
Rs.Close
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询