关于表格改为DIV的循环问题
姐夫唐 2007-02-11 11:54:33 下面这段代码是用表格循环显示数据:
'=================================================
Movievod="<table width=100% border=0 cellpadding=0 cellspacing=1 bgcolor=#F0F7FF>"
if Sclassid<>"" then
set rs=conn.execute("SELECT * FROM Movie where Sclassid="&Sclassid&" order by letter")
if not rs.eof then
i=0
do while not rs.eof
i=i+1
if thischar<>rs("letter") then
thischar=rs("letter")
i = 1
Movievod=Movievod&"<tr><td colspan=5 width=""100%"">"&thischar&"</td></tr><tr> "
end if
Movievod=Movievod&"<td width=""15%"">"&rs("NClass")&"</td>"
if (i mod 5)=0 and i>=5 then
Movievod=Movievod&"</tr>"
end if
rs.movenext
loop
end if
end if
set rs = nothing
set conn = nothing
Movievod=Movievod&"</table>"
'=================================================
五个单元格为一行地循环。我现在想改成DIV布局的,<li>里的内容从数据库读取,记录条数不定。显示方式为:
<div>
<ul>
<li>内容一</li>
<li>内容二</li>
</ul>
<ul>
<li>内容一</li>
<li>内容二</li>
<li>内容三</li>
</ul>
</div>
应该怎么改?