求助:asp如何实现新闻列表分两列显示?急!
<tablewidth="98%"border="0"cellpadding="0"cellspacing="0"class="news"><%'setrs=server...
<table width="98%" border="0" cellpadding="0" cellspacing="0" class="news">
<%'
set rs=server.CreateObject("adodb.recordset")
rs.open "select top 10 * from int86_news where anclassid=6 order by adddate desc",conn,1,1
%>
<%do while not rs.eof%>
<tr>
<td height="20"> ·<font color="#925f07"><a href="news_show.asp?id=<%=rs("id")%>" target="_blank">
<%if len(trim(rs("title")))>17 then
response.write left(trim(rs("title")),16)&"..."
else
response.write trim(rs("title"))
end if
%>
</a></font></td>
</tr>
<%
rs.movenext
loop
rs.close
set rs=nothing%>
</table> 展开
<%'
set rs=server.CreateObject("adodb.recordset")
rs.open "select top 10 * from int86_news where anclassid=6 order by adddate desc",conn,1,1
%>
<%do while not rs.eof%>
<tr>
<td height="20"> ·<font color="#925f07"><a href="news_show.asp?id=<%=rs("id")%>" target="_blank">
<%if len(trim(rs("title")))>17 then
response.write left(trim(rs("title")),16)&"..."
else
response.write trim(rs("title"))
end if
%>
</a></font></td>
</tr>
<%
rs.movenext
loop
rs.close
set rs=nothing%>
</table> 展开
1个回答
展开全部
直接用rs.movenext就可以
具体代码如下
<table width="98%" border="0" cellpadding="0" cellspacing="0" class="news">
<%'
set rs=server.CreateObject("adodb.recordset")
rs.open "select top 10 * from int86_news where anclassid=6 order by adddate desc",conn,1,1
%>
<%do while not rs.eof%>
<tr>
<td width="50%" height="20"> ·<font color="#925f07"><a href="news_show.asp?id=<%=rs("id")%>" target="_blank">
<%if len(trim(rs("title")))>17 then
response.write left(trim(rs("title")),16)&"..."
else
response.write trim(rs("title"))
end if
%>
</a></font></td>
<%rs.movenext%>
<td width="50%">·<font color="#925f07"><a href="news_show.asp?id=<%=rs("id")%>" target="_blank">
<%if len(trim(rs("title")))>17 then
response.write left(trim(rs("title")),16)&"..."
else
response.write trim(rs("title"))
end if
%>
</a></font></td>
</tr>
<%
rs.movenext
loop
rs.close
set rs=nothing%>
</table>
具体代码如下
<table width="98%" border="0" cellpadding="0" cellspacing="0" class="news">
<%'
set rs=server.CreateObject("adodb.recordset")
rs.open "select top 10 * from int86_news where anclassid=6 order by adddate desc",conn,1,1
%>
<%do while not rs.eof%>
<tr>
<td width="50%" height="20"> ·<font color="#925f07"><a href="news_show.asp?id=<%=rs("id")%>" target="_blank">
<%if len(trim(rs("title")))>17 then
response.write left(trim(rs("title")),16)&"..."
else
response.write trim(rs("title"))
end if
%>
</a></font></td>
<%rs.movenext%>
<td width="50%">·<font color="#925f07"><a href="news_show.asp?id=<%=rs("id")%>" target="_blank">
<%if len(trim(rs("title")))>17 then
response.write left(trim(rs("title")),16)&"..."
else
response.write trim(rs("title"))
end if
%>
</a></font></td>
</tr>
<%
rs.movenext
loop
rs.close
set rs=nothing%>
</table>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询