asp 橫排顯示數(shù)據(jù)
更新時間:2009年07月09日 00:22:30 作者:
asp 橫排顯示數(shù)據(jù)的方法,實際上就是控制tr td來實現(xiàn)多行多列的實現(xiàn)方法,大家可以先用靜態(tài)的表格然后循環(huán)輸出就可以了。
復制代碼 代碼如下:
<%
sql="select * from serr where order by id asc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%><style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
-->
</style>
<table width=""100%"" align='center'>
<%
for i=1 to rs.recordCount '變量i從1循環(huán)到數(shù)據(jù)庫中的全部記錄數(shù)
if (i mod 4 =1) then '每個tr顯示4個記錄,可根據(jù)需要自行修改
response.write "<tr>"
end if
response.write "<td width=200>"&rs("title")&"<br>"&rs("con")&"<br>"&rs("www")&"<br>"&rs("keyword")&"</td>"
if (i mod 4 = 0) then
response.write "</tr>"
end if
rs.movenext
next
rs.close
%>
</table>
相關文章
asp實現(xiàn)二進制字符串轉(zhuǎn)換為Unicode字符串
asp實現(xiàn)二進制字符串轉(zhuǎn)換為Unicode字符串...2007-08-08
Active Server Pages 錯誤 ''ASP 0201'' 修復方法
網(wǎng)上很多其他的解決方法, 但是我試了幾個小時, 都沒有解決問題, 最后是通過這個方法解決的.2010-07-07
ASP常用日期格式化函數(shù) FormatDate()
這篇文章主要介紹了ASP常用日期格式化函數(shù) FormatDate(),很多情況下我們需要自定義輸出格式需要的朋友可以參考下2016-12-12

