让操作更便捷:ASPTable类
发布时间:2016-10-08 21:15:18 所属栏目:Asp教程 来源:网络整理
导读:经常写代码,对于无聊的table、tr、td真是深恶痛绝,一遍又一遍编写着重复无聊的代码,昨天看《 ASP3.0高级编程》时,看到作者的一个ASP Table组件,感觉实在很
|
用法如下:
<!--#include file="conn.asp"-->
<!--#include file="cls_table.asp"-->
<style type="text/css">
.tableStyle{}{width:600px;border:1px solid #369;}
.thStyle{}{background:#369;color:#FFF;}
</style>
<%
Dim art_tab
set art_tab=new cls_table
With art_tab
.TableStyle="tableStyle"
.HeaderStyle="thStyle"
End With
openconn("db.mdb")
sqlstr="select top 10 * from [article]"
call openrs(sqlstr,1)
if not(rs.bof and rs.eof) then
With art_tab
.setrs(rs)
.addcol "ID","{$art_id$}","tdid"
.addcol "标题","<a href=""View.asp?id={$art_id$}
"">{$art_title$}</a>","td1"
.addcol "作者","{$art_author$}","td2"
.addcol "操作","编辑","td2"
End With
end if
Response.Write art_tab.gethtml()
closers()
closeconn()
set art_tab=nothing
%>(编辑:佛山站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |

