怎样让记录两列后自动转入下一行?

wenxiuyun10000 2004-08-08 05:36:08
怎样让记录两列后自动转入下一行?下面是这页的代码:
<!--#include file="../include/bkconn.asp"-->
<%
dim rs,sql
dim page,maxPerPage
maxPerPage=18 '每页显示的记录数
page=Request("page")
if (page="" or isempty(page)) then page=1
thisUrl="seccessList.asp?true=1"
session("adminOldUrl")=thisUrl&"&page="&page
set rs=server.createobject("adodb.recordset")
sql="select * from faq where 1=1"
sql=sql&" order by id desc"
'response.write sql
'response.End
rs.open sql,conn,1,1
rs.pagesize=MaxPerPage
%>
<html>
<head>
<title>案例</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../main.css" type="text/css">
<script language=Javascript>
<!--
function jumpTo(i){
if(i==1){
this.document.location="<%=thisUrl%>";}
if(i==2){
this.document.location="<%=thisUrl%>&page=<%=page-1%>";}
if(i==3){
this.document.location="<%=thisUrl%>&page=<%=page+1%>";}
if(i==4){
this.document.location="<%=thisUrl%>&page=<%=rs.pageCount%>";}
}

function deleteMe(i){
if (confirm("确定删除?可是恢复不了的啊。")==1){
window.location="saveFaqDel.asp?id="+i;
}
}
//-->
</script>
</head>

<body text="#000000" leftmargin="0" topmargin="0">
<div align="center"><br>
</div>
<div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<form method="post" action="newsList.asp" name="form1">
<td colspan="2">
<div align="center">
<div align="center">
<table cellSpacing="0" cellPadding="5" width="100%" bgColor="#ffffff" border="0">
<tr>
<td class="news_date" align="middle" width="100%" colSpan="2">
<b><font color="#000080">部分客户单位名称</font><font color="#d9d9d9">(排名不分先后)</font></b></td>
</tr>
</table>
</div>
</div>
</td>
</form>
</tr>
<tr>
<td width="50%" >
<div align="left"><b>客户名称</b></div>
</td>
<td width="50%" >
 </td>
</tr>
<%
dim rsID
i=1
if not (rs.eof or err) then rs.move (page-1)*maxPerPage
do while not (rs.eof or err)
rsID=rs("id")
%>
<tr>
<td width="488" title="成功案例">· <%=rs("question")%> </td>
<td width="489">
</td>
</tr>
<%
i=i+1
if i>maxPerPage then exit do
rs.moveNext
loop
%>
<tr>
<td colspan="2">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>

<td width="12%">
 </td>

<td width="88%">
<div align="right"><%=rs.recordCount%>项 第<%=page%>/<%=rs.pageCount%> 页 
<%if page>1 then%>
<input type="button" name="Submit3" value="首页" onClick="Javascript:jumpTo(1)">
<input type="submit" name="Submit4" value="上页" onClick="Javascript:jumpTo(2)">
<%else%>
<input type="button" name="Submit3" value="首页" disabled>
<input type="submit" name="Submit4" value="上页" disabled>
<%end if
if rs.recordCount>page*maxPerPage then%>
<input type="submit" name="Submit5" value="下页" onClick="Javascript:jumpTo(3)">
<input type="submit" name="Submit6" value="末页" onClick="Javascript:jumpTo(4)">
<%else%>
<input type="submit" name="Submit5" value="下页" disabled>
<input type="submit" name="Submit6" value="末页" disabled>
<%end if%>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
</html>
...全文
40 点赞 收藏 3
写回复
3 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
wenxiuyun10000 2004-08-09
这句要加到哪里?
回复
孟子E章 2004-08-08
i=0
While not rs.EOF
Response.Write rs(0)
if i Mod 2 = 0 Then Response.Write "<br>"
i = i+1
Rs.MoveNext
Wend
回复
cdsun 2004-08-08
你的意图是什么
我不大明白你的意思哦
是不是标题长了你让他转行?
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2004-08-08 05:36
社区公告
暂无公告