这段ASP代码如何让它分成一行两列内容显示
<%page=clng(request("page"))Setrs=Server.CreateObject("ADODB.RecordSet")ifBigClass<>"...
<%
page=clng(request("page"))
Set rs=Server.CreateObject("ADODB.RecordSet")
if BigClass<>"" and SmallClass <>"" then
sql="select * from news where BigClassName='"&BigClass&"' and SmallClassName='"&SmallClass&"' order by AddDate desc"
rs.Open sql,conn,1,1
elseif BigClass<>"" then
sql="select * from news where BigClassName='"&BigClass&"' order by AddDate desc"
rs.Open sql,conn,1,1
end if
if rs.eof and rs.bof then
response.Write("暂时没有记录")
else
%>
<%
rs.PageSize=20
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>
<td width="22" height="40" align="center" > </td>
<td width="24" height="40" align="center" >●</td>
<td width="133" height="40" align="center" ><img border="0" src="<%= RS("FirstImageName") %>" width="100" height="120"></td>
<td width="205" height="24" style="BORDER-bottom: #999999 1px dotted">
<a href="shownews.asp?id=<%= RS("id") %>" target="_blank"><%= RS("TITLE") %></a> </td>
<td width="61" style="BORDER-bottom: #999999 1px dotted"></td>
</tr>
<%
rs.movenext
if rs.eof then exit for
next
%> 展开
page=clng(request("page"))
Set rs=Server.CreateObject("ADODB.RecordSet")
if BigClass<>"" and SmallClass <>"" then
sql="select * from news where BigClassName='"&BigClass&"' and SmallClassName='"&SmallClass&"' order by AddDate desc"
rs.Open sql,conn,1,1
elseif BigClass<>"" then
sql="select * from news where BigClassName='"&BigClass&"' order by AddDate desc"
rs.Open sql,conn,1,1
end if
if rs.eof and rs.bof then
response.Write("暂时没有记录")
else
%>
<%
rs.PageSize=20
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>
<td width="22" height="40" align="center" > </td>
<td width="24" height="40" align="center" >●</td>
<td width="133" height="40" align="center" ><img border="0" src="<%= RS("FirstImageName") %>" width="100" height="120"></td>
<td width="205" height="24" style="BORDER-bottom: #999999 1px dotted">
<a href="shownews.asp?id=<%= RS("id") %>" target="_blank"><%= RS("TITLE") %></a> </td>
<td width="61" style="BORDER-bottom: #999999 1px dotted"></td>
</tr>
<%
rs.movenext
if rs.eof then exit for
next
%> 展开
2个回答
展开全部
循环输出中,改为这样即可:
<tr>
<td align="center" >●</td>
<td align="center" ><img border="0" src="<%= RS("FirstImageName") %>" width="100" height="120"></td>
<tr>
</tr>
<td style="BORDER-bottom: #999999 1px dotted"><a href="shownews.asp?id=<%= RS("id") %>" target="_blank"><%= RS("TITLE") %></a> </td>
<td style="BORDER-bottom: #999999 1px dotted"></td>
</tr>
<tr>
<td align="center" >●</td>
<td align="center" ><img border="0" src="<%= RS("FirstImageName") %>" width="100" height="120"></td>
<tr>
</tr>
<td style="BORDER-bottom: #999999 1px dotted"><a href="shownews.asp?id=<%= RS("id") %>" target="_blank"><%= RS("TITLE") %></a> </td>
<td style="BORDER-bottom: #999999 1px dotted"></td>
</tr>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询