帮忙修改一段程序!

xuyunbe1 2009-11-04 04:32:39
<%
set rs_news=server.createobject("adodb.recordset")
sqltext4="select top 20 * from news where bigclassname='新闻动态' order by id desc"
rs_news.open sqltext4,conn,1,1
%>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1">
<%i=0
do while not rs_news.eof%>
<tr align="center">
<td width="1%" height="25"><img src="images/19.gif" width="10" height="7" /></td>
<td height="25" align="left">
<p style='line-height:140%'><a href="shownews.asp?id=<%=rs_news("id")%>" target="_blank"> <%=cutstr(rs_news("title"),20)%></a>[<%=rs_news("Infotime")%>]<br></p></td>
</tr>
<%rs_news.movenext
i=i+1
loop
rs_news.close %>
</table>
这段程序执行结果是从上到下显示当前20条新闻,显示为一列。
帮忙修改一下,使之显示为三列,从上到下显示所有的信息!谢谢!
...全文
57 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
lzp4881 2009-11-04
  • 打赏
  • 举报
回复
<%
set rs_news=server.createobject("adodb.recordset")
sqltext4="select top 20 * from news where bigclassname='新闻动态' order by id desc"
rs_news.open sqltext4,conn,1,1
%>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1">
<%
do while not rs_news.eof
%>
<tr align="center">
<%for i=1 to 3%>
<td>
<table><tr>
<td width="1%" height="25"> <img src="images/19.gif" width="10" height="7" /> </td>
<td height="25" align="left">
<p style='line-height:140%'> <a href="shownews.asp?id= <%=rs_news("id")%>" target="_blank">  <%=cutstr(rs_news("title"),20)%> </a>[ <%=rs_news("Infotime")%>] <br> </p> </td>
</tr>
</table>
</td>
<%
if not rs_news.eof then rs_news.movenext
next
%>
</tr>
<%
loop
rs_news.close %>
</table>
上面错了,改一下
lzp4881 2009-11-04
  • 打赏
  • 举报
回复
<%
set rs_news=server.createobject("adodb.recordset")
sqltext4="select top 20 * from news where bigclassname='新闻动态' order by id desc"
rs_news.open sqltext4,conn,1,1
%>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1">
<%
do while not rs_news.eof
%>
<tr align="center">
<%for i=1 to 3%>
<td>
<table><tr>
<td width="1%" height="25"> <img src="images/19.gif" width="10" height="7" /> </td>
<td height="25" align="left">
<p style='line-height:140%'> <a href="shownews.asp?id= <%=rs_news("id")%>" target="_blank">  <%=cutstr(rs_news("title"),20)%> </a>[ <%=rs_news("Infotime")%>] <br> </p> </td>
</tr>
</table>
</td>
<%rs_news.movenext %>
</tr>
<%
loop
rs_news.close %>
</table>

28,406

社区成员

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

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