如何让原来显示1列的ASP代码改成两列?
<%submyline(classid)%><%ifclassid=1thentheclass=1sql_top="selecttop5*fromlinewhereop_...
<%sub myline(classid)%>
<%
if classid=1 then
theclass=1
sql_top="select top 5 * from line where op_type like '%"&theclass&"%' and classid=1 order by hots asc,id desc "
end if
if classid=2 then
theclass=1
sql_top="select top 5 * from line where op_type like '%"&theclass&"%' and classid=2 order by hots asc,id desc "
end if
if classid=3 then
theclass=1
sql_top="select top 5 * from line where op_type like '%"&theclass&"%' and classid=3 order by hots asc,id desc "
end if
if classid=4 then
theclass=1
sql_top="select top 5 * from line where op_type like '%"&theclass&"%' and classid=4 order by hots asc,id desc "
end if
set rs_top=Server.CreateObject("ADODB.Recordset")
rs_top.open sql_top,conn,1,1
if (rs_top.eof and rs_top.bof) then
response.write "<div align=center><p><br><font color=red>暂无任何信息</font></br></p></div>"
else%>
<%
do while not rs_top.eof
%>
<table width="380" height="24" border="0" cellpadding="0" cellspacing="0" style="border-bottom:1px #B2D4F5 dashed; ">
<tr>
<td width="8" style="padding-top:4PX"><img src="images/arrow.gif"></td>
<td width="242" style="padding-top:6PX"><a href="line/show.asp?id=<%=rs_top("id")%>" title="<%=rs_top("title")%>" target="_blank" class="12_0055AA"><%=left(rs_top("title"),17)%></a></td>
<td width="68" style="padding-top:6PX" class="F_12_0055AA"><%=rs_top("go_time")%></td>
<td width="62" align="right" style="padding-top:6PX" class="price1">¥<%=rs_top("price")%></td>
</tr>
</table>
<%
rs_top.movenext
loop
%>
<%
end if
rs_top.close
set rs_top=nothing%>
<%end sub%> 展开
<%
if classid=1 then
theclass=1
sql_top="select top 5 * from line where op_type like '%"&theclass&"%' and classid=1 order by hots asc,id desc "
end if
if classid=2 then
theclass=1
sql_top="select top 5 * from line where op_type like '%"&theclass&"%' and classid=2 order by hots asc,id desc "
end if
if classid=3 then
theclass=1
sql_top="select top 5 * from line where op_type like '%"&theclass&"%' and classid=3 order by hots asc,id desc "
end if
if classid=4 then
theclass=1
sql_top="select top 5 * from line where op_type like '%"&theclass&"%' and classid=4 order by hots asc,id desc "
end if
set rs_top=Server.CreateObject("ADODB.Recordset")
rs_top.open sql_top,conn,1,1
if (rs_top.eof and rs_top.bof) then
response.write "<div align=center><p><br><font color=red>暂无任何信息</font></br></p></div>"
else%>
<%
do while not rs_top.eof
%>
<table width="380" height="24" border="0" cellpadding="0" cellspacing="0" style="border-bottom:1px #B2D4F5 dashed; ">
<tr>
<td width="8" style="padding-top:4PX"><img src="images/arrow.gif"></td>
<td width="242" style="padding-top:6PX"><a href="line/show.asp?id=<%=rs_top("id")%>" title="<%=rs_top("title")%>" target="_blank" class="12_0055AA"><%=left(rs_top("title"),17)%></a></td>
<td width="68" style="padding-top:6PX" class="F_12_0055AA"><%=rs_top("go_time")%></td>
<td width="62" align="right" style="padding-top:6PX" class="price1">¥<%=rs_top("price")%></td>
</tr>
</table>
<%
rs_top.movenext
loop
%>
<%
end if
rs_top.close
set rs_top=nothing%>
<%end sub%> 展开
2个回答
2009-08-14
展开全部
有一个简便的方法,可参考(结合表格,以下格式套用后就可用)
<table border=0 cellpadding=0 cellspacing=0>
<%
'资料集及SQL语句
for i=1 to rs.recordcount
%>
<tr>
<%for j=1 to 2%>
<td>这裏在IE中就会显示一行两列</td>
<%
rs.movenext
if rs.eof then exit exit for
next
%>
</tr>
<%next%>
</table>
<table border=0 cellpadding=0 cellspacing=0>
<%
'资料集及SQL语句
for i=1 to rs.recordcount
%>
<tr>
<%for j=1 to 2%>
<td>这裏在IE中就会显示一行两列</td>
<%
rs.movenext
if rs.eof then exit exit for
next
%>
</tr>
<%next%>
</table>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询