中国沃尔沃随车吊价格:一段简单的代码请教 一段简单的代码请教

来源:百度文库 编辑:神马品牌网 时间:2024/05/05 06:42:06
说明,我需要调用2个新闻以后就分两列排
比如调用4个新闻就排成2行2列

请高手

代码如下:

<table cellspacing=0 cellpadding=0 width="100%" border=0 class=table-xia>
<tbody>
<%
i=0
set rs=server.CreateObject("adodb.recordset")
rs.open "select top 4 newsname,adddate,newsid from news order by adddate desc",conn,1,1
if rs.eof and rs.bof then
response.write "<center>目前还没有新闻!</center>"
else
do while not rs.eof
i=i+1
%>

<tr>
<td height=20 valign=center>  <img height=11 src="images/images0112.gif"
width=15 align=absMiddle border=0>
<%dim i

response.write "<a href=# onClick=""javascript:window.open('news.asp?id="&rs("newsid")&"','','width=432,height=288,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;"" title="&year(rs("adddate"))&"年"&month(rs("adddate"))&"月"&day(rs("adddate"))&"日发布>"&trim(rs("newsname"))&"</a><br>"
%>
</td>
</tr>
<tr>
<td background=images/bg_04.gif border=0></td>
</tr>

<% if i>=4 then exit do
rs.movenext
loop
end if
rs.close
set rs=nothing%>

</tbody>
</table>
答案出来了,请关注http://zhidao.baidu.com/question/11665110.html

我的网站也有这个问题,是图片新闻放3张页面就撑开了,还没解决呢,关注你的,看有没有也可以帮我解决哈.