记录的横向显示

来源:半月设计 发布人:guobar 发布时间:2005-7-1 8:39:20 人气: 所属栏目:ASP研究-ASP

以下是引用片段:
< %
strsql = "select * from Your_table"
objrs.open strsql,conn,1,1
%>
<table width=""100%"" align=’center’>
<%
for i=1 to objrs.recordCount   ’变量i从1循环到数据庫中的全部记录数
     if (i mod 5 =1) then  ’每个tr显示5个记录,可根据需要自行修改
         response.write "<tr>"
     end if 
         response.write "<td>"&objrs("title")&"</td>"
    if (i mod 5 = 0) then 
         response.write "</tr>"
    end if
objrs.movenext
next
objrs.close
%>
< /table >




生成时间:2006-5-27 9:03:32