把这个asp新闻列表弄成两列怎么弄啊,请高手们指点。
<tablewidth="100%"border="0"cellspacing="1"cellpadding="0"><%setrs_news=server.create...
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<%
set rs_news=server.createobject("adodb.recordset")
sqltext4="select top " & New_count & " * from 0791idc_news where BigClassName='企业新闻' order by AddDate desc"
rs_news.open sqltext4,conn,1,1
%>
<%i=0
do while not rs_news.eof%>
<tr align="center">
<td width="3%"><img src="Img/arrow_6.gif" width="11" height="11"> </td>
<td width="97%"> <div align="left">
<p style='line-height:180%'>
<% If ISHTML = 1 Then
AutoLink = "shownews.asp?ID="&rs_news("ID")&""
End If
Response.Write "<a href="""&AutoLink&""" target='_blank'>"&rs_news("TITLE")&"</a>"&VbCrLf
%>
<br>
</div></td>
</tr>
<%rs_news.movenext
i=i+1
loop
rs_news.close %>
</table>
这样有错误。 展开
<%
set rs_news=server.createobject("adodb.recordset")
sqltext4="select top " & New_count & " * from 0791idc_news where BigClassName='企业新闻' order by AddDate desc"
rs_news.open sqltext4,conn,1,1
%>
<%i=0
do while not rs_news.eof%>
<tr align="center">
<td width="3%"><img src="Img/arrow_6.gif" width="11" height="11"> </td>
<td width="97%"> <div align="left">
<p style='line-height:180%'>
<% If ISHTML = 1 Then
AutoLink = "shownews.asp?ID="&rs_news("ID")&""
End If
Response.Write "<a href="""&AutoLink&""" target='_blank'>"&rs_news("TITLE")&"</a>"&VbCrLf
%>
<br>
</div></td>
</tr>
<%rs_news.movenext
i=i+1
loop
rs_news.close %>
</table>
这样有错误。 展开
4个回答
展开全部
看看!
=====================================================
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<%
set rs_news=server.createobject("adodb.recordset")
sqltext4="select top " & New_count & " * from 0791idc_news where BigClassName='企业新闻' order by AddDate desc"
rs_news.open sqltext4,conn,1,1
%>
<%i=0
do while not rs_news.eof%>
<tr align="center">
<% if mod(rs_news("ID"))=1 then %>
<td width="3%"><img src="Img/arrow_6.gif" width="11" height="11"> </td>
<td width="97%"> <div align="left">
<p style='line-height:180%'>
<% If ISHTML = 1 Then
AutoLink = "shownews.asp?ID="&rs_news("ID")&""
End If
Response.Write "<a href="""&AutoLink&""" target='_blank'>"&rs_news("TITLE")&"</a>"&VbCrLf
%>
<br>
</div></td>
<% else %>
<!-- 第二列 -->
<td width="3%"><img src="Img/arrow_6.gif" width="11" height="11"> </td>
<td width="97%"> <div align="left">
<p style='line-height:180%'>
<% If ISHTML = 1 Then
AutoLink = "shownews.asp?ID="&rs_news("ID")&""
End If
Response.Write "<a href="""&AutoLink&""" target='_blank'>"&rs_news("TITLE")&"</a>"&VbCrLf
%>
<br>
</div></td>
<% end if%>
</tr>
<%rs_news.movenext
i=i+1
loop
rs_news.close %>
</table>
=========================================================
先吃饭了!你把中间所有<td width=97%>的数字自己改一改!改成!<tr></tr>之间所有的<td>里的数字加起来等于100%就行!(调整单元格的宽度)
============================================================
忘了除以2了把
<% if mod(rs_news("ID"))=1 then %>
改成
<% if rs_news("ID") mod 2 =1 then %>
=====================================================
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<%
set rs_news=server.createobject("adodb.recordset")
sqltext4="select top " & New_count & " * from 0791idc_news where BigClassName='企业新闻' order by AddDate desc"
rs_news.open sqltext4,conn,1,1
%>
<%i=0
do while not rs_news.eof%>
<tr align="center">
<% if mod(rs_news("ID"))=1 then %>
<td width="3%"><img src="Img/arrow_6.gif" width="11" height="11"> </td>
<td width="97%"> <div align="left">
<p style='line-height:180%'>
<% If ISHTML = 1 Then
AutoLink = "shownews.asp?ID="&rs_news("ID")&""
End If
Response.Write "<a href="""&AutoLink&""" target='_blank'>"&rs_news("TITLE")&"</a>"&VbCrLf
%>
<br>
</div></td>
<% else %>
<!-- 第二列 -->
<td width="3%"><img src="Img/arrow_6.gif" width="11" height="11"> </td>
<td width="97%"> <div align="left">
<p style='line-height:180%'>
<% If ISHTML = 1 Then
AutoLink = "shownews.asp?ID="&rs_news("ID")&""
End If
Response.Write "<a href="""&AutoLink&""" target='_blank'>"&rs_news("TITLE")&"</a>"&VbCrLf
%>
<br>
</div></td>
<% end if%>
</tr>
<%rs_news.movenext
i=i+1
loop
rs_news.close %>
</table>
=========================================================
先吃饭了!你把中间所有<td width=97%>的数字自己改一改!改成!<tr></tr>之间所有的<td>里的数字加起来等于100%就行!(调整单元格的宽度)
============================================================
忘了除以2了把
<% if mod(rs_news("ID"))=1 then %>
改成
<% if rs_news("ID") mod 2 =1 then %>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
网易云信
2023-12-06 广告
2023-12-06 广告
很高兴能回答您的问题。以下是一段针对“一对一消息组件”的描述,字数在200字左右:该组件支持用户之间的私密交流,让沟通更加直接和高效。通过它,您可以向特定对象发送消息,并实时查看消息状态,包括对方是否已读或未读。同时,该组件还支持富文本消息...
点击进入详情页
本回答由网易云信提供
展开全部
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<%
set rs_news=server.createobject("adodb.recordset")
sqltext4="select top " & New_count & " * from 0791idc_news where BigClassName='企业新闻' order by AddDate desc"
rs_news.open sqltext4,conn,1,1
%>
<%i=0
do while not rs_news.eof%>
<tr align="center">
<% if mod(rs_news("ID"))=1 then %>
<td width="3%"><img src="Img/arrow_6.gif" width="11" height="11"> </td>
<td width="97%"> <div align="left">
<p style='line-height:180%'>
<% If ISHTML = 1 Then
AutoLink = "shownews.asp?ID="&rs_news("ID")&""
End If
Response.Write "<a href="""&AutoLink&""" target='_blank'>"&rs_news("TITLE")&"</a>"&VbCrLf
%>
<br>
</div></td>
<% else %>
<!-- 第二列 -->
<td width="3%"><img src="Img/arrow_6.gif" width="11" height="11"> </td>
<td width="97%"> <div align="left">
<p style='line-height:180%'>
<% If ISHTML = 1 Then
AutoLink = "shownews.asp?ID="&rs_news("ID")&""
End If
Response.Write "<a href="""&AutoLink&""" target='_blank'>"&rs_news("TITLE")&"</a>"&VbCrLf
%>
<br>
</div></td>
<% end if%>
</tr>
<%rs_news.movenext
i=i+1
loop
rs_news.close %>
</table>
<tr></tr>之间所有的<td>里的数字加起来等于100%就行!(调整单元格的宽度)
另外将
<% if mod(rs_news("ID"))=1 then %>
改成
<% if rs_news("ID") mod 2 =1 then %>
试了一下,是可行的
<%
set rs_news=server.createobject("adodb.recordset")
sqltext4="select top " & New_count & " * from 0791idc_news where BigClassName='企业新闻' order by AddDate desc"
rs_news.open sqltext4,conn,1,1
%>
<%i=0
do while not rs_news.eof%>
<tr align="center">
<% if mod(rs_news("ID"))=1 then %>
<td width="3%"><img src="Img/arrow_6.gif" width="11" height="11"> </td>
<td width="97%"> <div align="left">
<p style='line-height:180%'>
<% If ISHTML = 1 Then
AutoLink = "shownews.asp?ID="&rs_news("ID")&""
End If
Response.Write "<a href="""&AutoLink&""" target='_blank'>"&rs_news("TITLE")&"</a>"&VbCrLf
%>
<br>
</div></td>
<% else %>
<!-- 第二列 -->
<td width="3%"><img src="Img/arrow_6.gif" width="11" height="11"> </td>
<td width="97%"> <div align="left">
<p style='line-height:180%'>
<% If ISHTML = 1 Then
AutoLink = "shownews.asp?ID="&rs_news("ID")&""
End If
Response.Write "<a href="""&AutoLink&""" target='_blank'>"&rs_news("TITLE")&"</a>"&VbCrLf
%>
<br>
</div></td>
<% end if%>
</tr>
<%rs_news.movenext
i=i+1
loop
rs_news.close %>
</table>
<tr></tr>之间所有的<td>里的数字加起来等于100%就行!(调整单元格的宽度)
另外将
<% if mod(rs_news("ID"))=1 then %>
改成
<% if rs_news("ID") mod 2 =1 then %>
试了一下,是可行的
参考资料: 想念静思
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
给你精简了一下
----------------------------------------------------------
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<%set rs_news=server.createobject("adodb.recordset")
sqltext4="select top " & New_count & " * from 0791idc_news where BigClassName='企业新闻' order by AddDate desc"
rs_news.open sqltext4,conn,1,1
if not rs_news.eof then
while not rs_news.eof%>
<tr>
<%for i=1 to 2
'这个判断必须
if rs_news.eof then exit for %>
<td width="3%"><img src="Img/arrow_6.gif" width="11" height="11"></td>
<td width="97%" align="center">
<% If ISHTML = 1 Then
AutoLink = "shownews.asp?ID="&rs_news("ID")&""
End If
Response.Write "<a href="""&AutoLink&""" target='_blank'>"&rs_news("TITLE")&"</a>"&VbCrLf
%>
</td>
<%rs_news.movenext
next%>
</tr>
<%Wend
rs_news.close %>
</table>
----------------------------------------------------------
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<%set rs_news=server.createobject("adodb.recordset")
sqltext4="select top " & New_count & " * from 0791idc_news where BigClassName='企业新闻' order by AddDate desc"
rs_news.open sqltext4,conn,1,1
if not rs_news.eof then
while not rs_news.eof%>
<tr>
<%for i=1 to 2
'这个判断必须
if rs_news.eof then exit for %>
<td width="3%"><img src="Img/arrow_6.gif" width="11" height="11"></td>
<td width="97%" align="center">
<% If ISHTML = 1 Then
AutoLink = "shownews.asp?ID="&rs_news("ID")&""
End If
Response.Write "<a href="""&AutoLink&""" target='_blank'>"&rs_news("TITLE")&"</a>"&VbCrLf
%>
</td>
<%rs_news.movenext
next%>
</tr>
<%Wend
rs_news.close %>
</table>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询