如何在ASP中实现横排和坚排都循环,我现在的是坚排想改为横排
现在的方式是
1
2
3
4
5
6
7
分页
想改为横排方式显示5*7
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31 32 33 34 35
36 37 38 39 40 41 42
分页
现在的代码如下
<BODY onload=javascript:init();>
<!--#include file=checklogin.asp-->
<!--#include file=conn.asp-->
<%set rs11=server.CreateObject("adodb.recordset")
rs11.Open "select allmon,logs,sex,sheng,shi from
A_user where uname='"&session("username")
&"'",conn,1,1
if rs11.recordcount>0 then
sex=rs11("sex")
sheng8=rs11("sheng")
shi8=rs11("shi")
logs=int(rs11("logs"))
allmon=int(rs11("allmon"))
if logs>10 and allmon<100 then'---积分少于10提示充
值
response.Write "<script
LANGUAGE='javascript'>alert('俱乐部,提醒
您!');</script>"
end if
end if
rs11.close
set rs11=nothing
%>
<div id="list3">
<dl>
<dd class="xm1"> <FORM id=register name=register
onsubmit="return checkw()" action="NetWork.asp"
method=get><SELECT onchange=select()
name=jsprovince></SELECT>
<SELECT onchange=select()
name=jscity></SELECT><INPUT type=submit value=搜索
会员 name=Submit>
</form></dd>
</dl>
<!--LIST结束 --></div>
<!--CONTENT结束 --></div>
<div align="center" style="line-height:2.1">
<!--table开始 -->
<%sql="select * from A_user where id>0"
if sex<>"" then
sql=sql&" and sex<>"&sex&""
end if
if trim(request("jsprovince"))<>"" then
sheng=trim(request("jsprovince"))
sql=sql&" and sheng='"&sheng&"'"
end if
if trim(request("jscity"))<>"" then
shi=trim(request("jscity"))
sql=sql&" and shi='"&shi&"'"
end if
sql2=sql
if trim(sheng8)<>"" and trim(request
("jsprovince"))="" then
sql2=sql2&" and sheng='"&sheng8&"'"
sql=sql&" and sheng='"&sheng8&"'"
end if
if trim(shi8)<>"" and trim(request("jscity"))=""
then
sql=sql&" or shi='"&shi8&"'"
sql2=sql2&" and shi='"&shi8&"'"
end if
sql=sql&" order by sex asc,id desc"
sql2=sql2&" order by sex asc,id desc"
'response.write sql
set rs=server.CreateObject("adodb.recordset")
rs.Open sql2,conn,1,1
if rs.eof=false then
else
rs.close
rs.Open sql,conn,1,1
end if
page=cint(request("page"))
n=rs.RecordCount
rs.pagesize=4
m=cint(rs.pagecount)
if page="" then
page=1
elseif page<1 then
page=1
end if
if cint(request("page"))>m then
page=m
end if
page=cint(page)
if not rs.eof then
rs.absolutepage=page
end if
if m>page+10 then
endpage=page+10
else
endpage=m
end if
if page>6 then
pagetitle=pagetitle & " " & "...."
end if
for i=page-10 to endpage
if not i<1 then
if i = page then
pagetitle=pagetitle &" "&"<a href=?
jsprovince="&request.querystring("jsprovince")
&"&jscity="&request.querystring("jscity")&"&page="
& i & " class=cur><font color=blue>"& i &
"</font></a>"
else
pagetitle=pagetitle & " " & "" & "<a href=?
jsprovince="&request.querystring("jsprovince")
&"&jscity="&request.querystring("jscity")&"&page="
& i & ">" & i & "<a>" & ""
end if
end if
next
if page+10 < m then
pagetitle=pagetitle & " " & "...."
end if
jj=0
do while rs.eof=false
%>
<TABLE cellSpacing=1 cellPadding=3 width=80
align=center bgColor=#c6d7c6 border=0>
<TBODY>
<TR align=middle bgColor=#f5faf5>
<TD width=100 rowSpan=5>
<!--会员显示区域-->
<A href="/info.asp?uid=<%=rs("id")%>"
target=_blank>
<FONT color=#ff0000><%=rs("uname")%></FONT></A>
</TD>
</TR>
</TBODY></TABLE>
<br style="line-height:14px;" >
<% jj=jj+1
if jj mod 20 =0 then exit do
rs.movenext
loop
rs.close
set rs=nothing
%>
</div><!--table-->
<div style="clear: both;"> </div>
<div id="list4">
分页:<a href ="/main.asp?jsprovince=<%=jsprovince
%>&jscity=<%=jscity%>">首页</a><%=pagetitle%>
<!--LIST结束 --></div>
<!--主体 wrapper --></div>
<br />
<div id="list1">
<dl>
<dd class="xm">
<!--LIST结束 --></div>
</DIV>
</body>
|