求求高手帮忙修改网页代码

来源:百度知道 编辑:UC知道 时间:2024/06/22 17:15:51
求求各位高手帮我修改一下代码
各位高手下面这个代码,是显示一列的,我想让他显示多列,该怎么修改,谢谢了

<%
theclass=1
sql_top="select top 10 * from plane where op_type like '%"&theclass&"%' order by hots asc,id desc "
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%>
<table width="220" border="0" cellpadding="0" cellspacing="0">
<%
do while not rs_top.eof
%>
<tr>
<td width="8" height="20"><img src="images/arrow.gif"></td>

<%
response.Write("<table border='0' cellpadding='0' cellspacing='0'>")
for i=1 to rsp.pagesize
if rsp.Eof then
Exit for
end if
if i mod 2=1 then response.write "<tr>"
response.Write("<td width='370' height='20' align='left' valign='top'>")

%>
显示的内容
<%
response.Write("</td>")
if i mod 2=0 then response.write "</tr>"

rsp.movenext
next
response.Write("</table>")
%>

我用的for循环展示,你参考下 do loop循环的话,你要dim 一个整数每循环一次让他加一,有判断语句判断它的值 显示行和列。"if i mod 2=1 then"这句中的2你可以改成其它的列数,我这里是2列

循环 td就好了
在需要换行的地方 加 </tr><tr>