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

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>
...全文
98 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
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
  • 打赏
  • 举报
回复
你的意图是什么
我不大明白你的意思哦
是不是标题长了你让他转行?

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧