华夏幸福有多少子公司:关于ASP分列显示

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/29 00:38:43
'显示文字链接
function linkstxt()
StrSql = "select * from sogo_link where sogo_link_logo_or_txt=1 and sogo_link_yes_no=1 order by id"
Set rs = server.CreateObject("ADODB.RecordSet")
rs.Open StrSql,Conn,1,2
if rs.eof then
else
response.write"<table width=750 align=center border=0 cellpadding=0 cellspacing=1 bgcolor=#FFFFFF><tr><td>"
for link=0 to rs.recordcount
if rs.eof or link=rs.recordcount then exit for
response.write"[ <a href="&rs("sogo_link_url")&" target=_blank>"&rs("sogo_link_font")&"</a> ] "
rs.movenext
next
response.write"</td></tr></table>"
end if
rs.close
end function

请教各位大侠,这段代码如何实现分列显示?
就是,一行固定显示几个,超出了,就换到下一行。

不用table用 div 你会觉得 阿 更容易更改。。。
rs.Open StrSql,Conn,1,2
if rs.eof then
else
'response.write"<table width=750 align=center border=0 cellpadding=0 cellspacing=1 bgcolor=#FFFFFF><tr><td>"
for link=0 to rs.recordcount
if rs.eof or link=rs.recordcount then exit for
'假如你的Function接收一个Rows的参数
response.Write "<div style=""float:left;width:"&100/rows&"%;"">"
response.write "[ <a href="&rs("sogo_link_url")&" target=_blank>"&rs("sogo_link_font")&"</a> ] "
response.Write "</div>"
rs.movenext
next
'response.write"</td></tr></table>"
end if
rs.close
end function

response.write" [<a href=" & rs("sogo_link_url") & " target=_blank>"
i=1
str=rs("sogo_link_font")
while i<=len(str)
if i mod 10 = 0 then
str = left(str,i) & chr(10) & "<br>" & right(str,len(str)-i)
i=i+2
end if
i=i+1
wend
response.write str
resposen.write"</a>]"

分列显示?什么意思啊