高分求救!!!急呀!!!!!!!!

请问下如何在一行中显示两列内容,比如在第一列中我要它显示10条,完了之后转到第二列接着显示剩下的内容。我的这段代码是这样的<tablewidth="728"border=... 请问下如何在一行中显示两列内容,比如在第一列中我要它显示10条,完了之后转到第二列接着显示剩下的内容。我的这段代码是这样的
<table width="728" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="602" valign="top" background="image/right_bj.gif"><table width="728" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="75" valign="bottom"><div align="center"><img src="image/zxps.gif" width="530" height="46"></div></td>
</tr>
<tr>
<td valign="top"><table width="685" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<%
page=clng(request("page"))
set rs=server.CreateObject("adodb.recordset")
sql="select * from links order by id desc"
rs.open sql,conn,1,3

if rs.bof and rs.eof then
response.Write "<td height=150 align=center colspan=10 bgcolor=#CFC19E> no,file</td>"
else

rs.PageSize=14
if page=0 then page=1
pages=rs.pagecount
if page > pages then page=pages
rs.AbsolutePage=page

for j=1 to rs.PageSize

%>
<tr class="fornt1">
<td width="11%"> </td>
<td width="8%"><div align="right"><img src="image/tb.gif" width="3" height="3"></div></td>
<td width="2%"> </td>
<td width="79%" height="30"><a href="<%=Rs("link")%>" target="_blank"><%=rs("name")%></a></td>
</tr>
<%
s=s+1
rs.movenext
if rs.eof then exit for
next
%>
</table>
<form id="form1" name="form1" method="post" action="">
<table width="567" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20" class="fornt"><div align="center" class="fornt1">
<%if Page<2 then
response.write "首页 上一页 "
else
response.write "<a href=jcmp.asp?page=1>首页</a> "
response.write "<a href=jcmp.asp?page=" & Page-1 & ">上一页</a> "
end if
if rs.pagecount-page<1 then
response.write "下一页 尾页"
else
response.write "<a href=jcmp.asp?page=" & (page+1) & ">"
response.write "下一页</a> <a href=jcmp.asp?page="&rs.pagecount&">尾页</a>"
end if
response.write " 页次:<strong><font color=red>"&Page&"/"&rs.pagecount&"</strong>页 "

response.write " 转到:<input type='text' name='page' size=4 maxlength=10 class=input value="&page&">"
response.write " <input class=input type='submit' value=' Goto ' name='cndok'></span>"
end if
%>
</div></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
</table>
恩,是的就是这个意思,但我现在用了你写的代码看了下效果也不是很好,因为在没有10条的时候右边就好空,可不可以以这样的顺序来显示就是左边显示一条接着右边显示一条,一页共显示20条信息,这样右边就不会好空了,解决了追加30分
展开
 我来答
度老虎
2008-06-18 · TA获得超过1548个赞
知道大有可为答主
回答量:1661
采纳率:100%
帮助的人:2493万
展开全部
试试:
<table width="728" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="602" valign="top" background="image/right_bj.gif"><table width="728" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="75" valign="bottom"><div align="center"><img src="image/zxps.gif" width="530" height="46"></div></td>
</tr>
<tr>
<td valign="top"><table width="685" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<%
page=clng(request("page"))
set rs=server.CreateObject("adodb.recordset")
sql="select * from links order by id desc"
rs.open sql,conn,1,3

if rs.bof and rs.eof then
response.Write "<tr><td height=150 align=center colspan=10 bgcolor=#CFC19E> no,file</td></tr>"
else

rs.PageSize=14
if page=0 then page=1
pages=rs.pagecount
if page > pages then page=pages
rs.AbsolutePage=page
k=1
for j=1 to rs.PageSize
if k=1 then Response.Write "<tr class=""fornt1"">"
%>
<td width="5%"> </td>
<td width="4%"><div align="right"><img src="image/tb.gif" width="3" height="3"></div></td>
<td width="1%"> </td>
<td width="40%" height="30"><a href="<%=Rs("link")%>" target="_blank"><%=rs("name")%></a></td>
<%
if k=2 then Response.Write "</tr>" : k=1
k=k+1
s=s+1
rs.movenext
if rs.eof then exit for
next
%>
</table>
<form id="form1" name="form1" method="post" action="">
<table width="567" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20" class="fornt"><div align="center" class="fornt1">
<%if Page<2 then
response.write "首页 上一页 "
else
response.write "<a href=jcmp.asp?page=1>首页</a> "
response.write "<a href=jcmp.asp?page=" & Page-1 & ">上一页</a> "
end if
if rs.pagecount-page<1 then
response.write "下一页 尾页"
else
response.write "<a href=jcmp.asp?page=" & (page+1) & ">"
response.write "下一页</a> <a href=jcmp.asp?page="&rs.pagecount&">尾页</a>"
end if
response.write " 页次:<strong><font color=red>"&Page&"/"&rs.pagecount&"</strong>页 "

response.write " 转到:<input type='text' name='page' size=4 maxlength=10 class=input value="&page&">"
response.write " <input class=input type='submit' value=' Goto ' name='cndok'></span>"
end if
%>
</div></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
</table>
===========================================
看了你的提问和代码,不是很明白你的意思。
是不是要分左右两栏显示,每栏10条记录,这10条记录分10行显示?
<table width="728" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="602" valign="top" background="image/right_bj.gif"><table width="728" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="75" valign="bottom"><div align="center"><img src="image/zxps.gif" width="530" height="46"></div></td>
</tr>
<tr>
<td valign="top"><table width="685" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<%
page=clng(request("page"))
set rs=server.CreateObject("adodb.recordset")
sql="select * from links order by id desc"
rs.open sql,conn,1,3

if rs.bof and rs.eof then
response.Write "<tr><td height=150 align=center colspan=10 bgcolor=#CFC19E> no,file</td></tr>"
else

rs.PageSize=14
if page=0 then page=1
pages=rs.pagecount
if page > pages then page=pages
rs.AbsolutePage=page
%>
<tr>
<td width="50%">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<%
for j=1 to rs.PageSize
%>
<tr class="fornt1">
<td width="11%"> </td>
<td width="8%"><div align="right"><img src="image/tb.gif" width="3" height="3"></div></td>
<td width="2%"> </td>
<td width="79%" height="30"><a href="<%=Rs("link")%>" target="_blank"><%=rs("name")%></a></td>
</tr>
<%
if j=10 then
%>
</table>
</td>
<td width="50%">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<%
end if
s=s+1
rs.movenext
if rs.eof then exit for
next
%>
</table>
</td>
</tr>
</table>
<form id="form1" name="form1" method="post" action="">
<table width="567" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20" class="fornt"><div align="center" class="fornt1">
<%if Page<2 then
response.write "首页 上一页 "
else
response.write "<a href=jcmp.asp?page=1>首页</a> "
response.write "<a href=jcmp.asp?page=" & Page-1 & ">上一页</a> "
end if
if rs.pagecount-page<1 then
response.write "下一页 尾页"
else
response.write "<a href=jcmp.asp?page=" & (page+1) & ">"
response.write "下一页</a> <a href=jcmp.asp?page="&rs.pagecount&">尾页</a>"
end if
response.write " 页次:<strong><font color=red>"&Page&"/"&rs.pagecount&"</strong>页 "

response.write " 转到:<input type='text' name='page' size=4 maxlength=10 class=input value="&page&">"
response.write " <input class=input type='submit' value=' Goto ' name='cndok'></span>"
end if
%>
</div></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
</table>
研究报告站
2008-06-17 · TA获得超过195个赞
知道小有建树答主
回答量:441
采纳率:0%
帮助的人:348万
展开全部
先在循环前做好表头
然后循环的时候输出行列就行了,可以找个简单的列表看看其代码,看其如何组织的。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式