<% ' +---------------------------------------------------------------------- ' | POPASP [ ASP MVC ] ' +---------------------------------------------------------------------- ' | Copyright (c) 2016 http://popasp.com All rights reserved. ' +---------------------------------------------------------------------- ' | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) ' +---------------------------------------------------------------------- ' | Author: popasp <1737025626@qq.com> ' +---------------------------------------------------------------------- Class POPASP_HTML '从数据库中取出的数据为二维Dictionary对象,可以将其转化为Table表格 public Function Table( ByRef dict , ByRef caption,ByRef topTr,ByRef bottomTr ) dim html,i,k1,k2,item html = "" if caption <> "" then html = html & VbCrLf & vbTab & "" end if i = 0 for each k1 in dict set item = dict(k1) if i = 0 then if topTr <> "" then html = html & VbCrLf & vbTab & "" end if html = html & VbCrLf & vbTab & "" html = html & VbCrLf & vbTab & vbTab for each k2 in item html = html & "" next html = html & VbCrLf & vbTab & "" end if if i mod 2 = 1 then html = html & VbCrLf & vbTab & "" else html = html & VbCrLf & vbTab & "" end if html = html & VbCrLf & vbTab & vbTab for each k2 in item html = html & "" next html = html & VbCrLf & vbTab & "" i = i + 1 next if bottomTr <> "" then html = html & VbCrLf & vbTab & "" end if set item = nothing html = html & VbCrLf & "
" & caption & "
" & topTr & "
" & k2 & "
" & item(k2) & "
" & bottomTr & "
" Table = html End Function Public Property Get Css( byval path ) Response.write "" End Property Public Property Get Js( byval path ) Response.write "" End Property Public Property Get [Load]( byval path ) if POP_MVC.String.iEndsWith( path , ".css" ) then Me.Css( path ) else Me.Js( path ) end if End Property Public Property Get pageCss() Response.Write POP_MVC.file_get_contents(POP_MVC.mvc_dir & "Tpl/popasp_page.css") End Property Public Property Get tableCss() Response.Write POP_MVC.file_get_contents(POP_MVC.mvc_dir & "Tpl/popasp_table.css") End Property End Class %>