?? class_html_table.asp
字號:
<%
Class classTable
'===================================================================
'= Description : Class's parameters define
'= Time : Created At OCT,19,2003
'= Change Log :
'= 2006-4-19 增加回車換行
'===================================================================
Private strBorder '== table's border
Private strPadding
Private strSpacing
Private strWidth
Private strAlign
Private strClass
Private strPostFile '== 提交的頁面鏈接
Private strValign,intColumn
Private strHtmlCode
Private strTrScale
Private intOutFlag '== 0, output html
'== 1, return html
'== 2, return and output html
'===================================================================
'= Description : Class's initialization
'= Time : Created At OCT,19,2003
'= Modify :
'= Time Description
'===================================================================
Private Sub Class_Initialize()
strBorder = "0"
strPadding = "0"
strSpacing = "0"
strWidth = "100%"
strAlign = "center"
strValign = "middle"
strClass = "TBone1"
intColumn = 0
strPostFile = "./"
strTrScale = "100%"
intOutFlag = 0
End Sub
'===================================================================
'= Description : Class's terminate
'= Time : Created At OCT,19,2003
'= Modify :
'= Time Description
'===================================================================
Private Sub Class_Terminate()
Set strHtmlCode = Nothing
End Sub
'===================================================================
'= Description : Set members parameters
'= Time : Created At OCT,19,2003
'= Modify :
'= Time Description
'===================================================================
Public Property Let Border(value)
strBorder = Trim(value)
End Property
Public Property Let ClassType(value)
strClass = Trim(value)
End Property
Public Property Let CellPadding(value)
strPadding = Trim(value)
End Property
Public Property Let CellSpacing(value)
strSpacing = Trim(value)
End Property
Public Property Let Width(value)
strWidth = Trim(value)
End Property
Public Property Let VAlign(value)
strValign = Trim(value)
End Property
Public Property Let Align(value)
strAlign = Trim(value)
End Property
Public Property Let PostFile(value)
strPostFile = Trim(value)
End Property
Public Property Let Colspan(value)
intColumn = Trim(value)
End Property
Public Property Let TrScale(value)
strTrScale = Trim(value)
End Property
Public Property Let OutFlag(value)
intOutFlag = Trim(value)
End Property
'===================================================================
'= Description : Set public functions and sub of class
'= Time : Created At OCT,19,2003
'===================================================================
Public Sub MakeTable()
strHtmlCode = "<table border=" & strBorder
strHtmlCode = strHtmlCode & " cellpadding=" & strPadding
strHtmlCode = strHtmlCode & " cellspacing=" & strSpacing
strHtmlCode = strHtmlCode & " align=" & strAlign
strHtmlCode = strHtmlCode & " valign=" & strValign
strHtmlCode = strHtmlCode & " width=" & strWidth
strHtmlCode = strHtmlCode & " class=" & strClass
strHtmlCode = strHtmlCode & " style='word-break:break-all'>" & chr(13) & chr(10) & "<tbody>" & chr(13) & chr(10)
strHtmlCode = strHtmlCode & "[toptr][titletr][tr][bottomtr]" & chr(13) & chr(10)
strHtmlCode = strHtmlCode & "</tbody></table>" & chr(13) & chr(10)
End Sub
Public Sub AddTitleTr(strTrClass)
Dim strTmp
If strTrClass = "" Then
strTmp = "<tr " & " width=" & strTrScale & ">" & chr(13) & chr(10)
Else
strTmp = "<tr class=" & strTrClass & " width=" & strTrScale & ">" & chr(13) & chr(10)
End If
strTmp = strTmp & " [titletd]</tr>" & chr(13) & chr(10)
strHtmlCode = Replace(strHtmlCode,"[titletr]",strTmp)
End Sub
Public Sub AddTitleTd(strTdValue,strTdClass,strScale)
Dim strTmp
If strTdClass = "" Then
strTmp = "<td "
Else
strTmp = "<td class=" & strTdClass
End If
strTmp = strTmp & " width=" & strScale & " valign=top>" & chr(13) & chr(10)
strTmp = strTmp & strTdValue & "</a>"
strTmp = strTmp & "</td>[titletd]" & chr(13) & chr(10)
strHtmlCode = Replace(strHtmlCode,"[titletd]",strTmp)
intColumn = intColumn + 1
End Sub
Public Sub AddTitleLinkTd(strTdValue,strTdClass,strScale,strQuery)
Dim strTmp
strTmp = "<td class=" & strTdClass
strTmp = strTmp & " width=" & strScale & ">" & chr(13) & chr(10)
strTmp = strTmp & "<a href='" & strPostFile & Trim(strQuery) & "' title='按" & strTdValue & "排序'>"
strTmp = strTmp & strTdValue & "↓</a>"
strTmp = strTmp & "</td>" & chr(13) & chr(10) & "[titletd]"
strHtmlCode = Replace(strHtmlCode,"[titletd]",strTmp)
intColumn = intColumn + 1
End Sub
Public Sub AddTr(strTrClass)
Dim strTmp
strHtmlCode = Replace(strHtmlCode,"[td]","")
If strTrClass = "" Then
strTmp = "<tr " & " width=" & strTrScale & ">"
Else
strTmp = "<tr class=" & strTrClass & " width=" & strTrScale & " >"
End If
strTmp = strTmp & "[td]</tr> " & chr(13) & chr(10) & "[tr]"
strHtmlCode = Replace(strHtmlCode,"[tr]",strTmp)
End Sub
Public Sub AddTd(strTdValue,strTdClass)
Dim strTmp
If strTdClass = "" Then
strTmp = "<td >" & chr(13) & chr(10)
Else
strTmp = "<td class=" & strTdClass & " valign=top>" & chr(13) & chr(10)
End If
strTmp = strTmp & strTdValue
strTmp = strTmp & "</td>" & chr(13) & chr(10) & "[td]"
strHtmlCode = Replace(strHtmlCode,"[td]",strTmp)
End Sub
Public Sub EndTd()
strHtmlCode = Replace(strHtmlCode,"[td]","")
End Sub
Public Sub AddInfoTr(strTrClass,strPosition)
Dim strTmp
If strTrClass = "" Then
strTmp = "<tr " & " width=" & strTrScale & ">" & chr(13) & chr(10)
Else
strTmp = "<tr class=" & strTrClass & " width=" & strTrScale & ">" & chr(13) & chr(10)
End If
strHtmlCode = Replace(strHtmlCode,"[infotd]","")
Select Case Ucase(strPosition)
Case "TOP" :
strTmp = strTmp & " [infotd]</tr>" & chr(13) & chr(10) & "[toptr]"
strHtmlCode = Replace(strHtmlCode,"[toptr]",strTmp)
Case "CURRENT" :
strTmp = strTmp & " [infotd]</tr>" & chr(13) & chr(10) & "[tr]"
strHtmlCode = Replace(strHtmlCode,"[tr]",strTmp)
Case "BOTTOM" :
strTmp = strTmp & " [infotd]" & chr(13) & chr(10) & "</tr>[bottomtr]"
strHtmlCode = Replace(strHtmlCode,"[bottomtr]",strTmp)
Case Else :
strTmp = strTmp & " [infotd]" & chr(13) & chr(10) & "</tr>[tr]"
strHtmlCode = Replace(strHtmlCode,"[tr]",strTmp)
End Select
End Sub
Public Sub AddInfoTrHidden(strTrClass,strTrName,strPosition)
Dim strTmp
If strTrClass = "" Then
strTmp = "<tr " & " width=" & strTrScale & " id=" & strTrName & " name=" & strTrName & " style='DISPLAY: none'>" & chr(13) & chr(10)
Else
strTmp = "<tr class=" & strTrClass & " width=" & strTrScale & " id=" & strTrName & " name=" & strTrName & " style='DISPLAY: none'>" & chr(13) & chr(10)
End If
strHtmlCode = Replace(strHtmlCode,"[infotd]","")
Select Case Ucase(strPosition)
Case "TOP" :
strTmp = strTmp & " [infotd]" & chr(13) & chr(10) & "</tr>[toptr]"
strHtmlCode = Replace(strHtmlCode,"[toptr]",strTmp)
Case "CURRENT" :
strTmp = strTmp & " [infotd]" & chr(13) & chr(10) & "</tr>[tr]"
strHtmlCode = Replace(strHtmlCode,"[tr]",strTmp)
Case "BOTTOM" :
strTmp = strTmp & " [infotd]</tr>[bottomtr]"
strHtmlCode = Replace(strHtmlCode,"[bottomtr]",strTmp)
Case Else :
strTmp = strTmp & " [infotd]" & chr(13) & chr(10) & "</tr>[tr]"
strHtmlCode = Replace(strHtmlCode,"[tr]",strTmp)
End Select
End Sub
Public Sub AddInfoTdHidden(strValue,strTdName,strTdClass)
Dim strTmp
If strTdClass = "" Then
strTmp = "<td "
Else
strTmp = "<td class=" & strTdClass
End If
strTmp = strTmp & " colspan=" & intColumn & " id=" & strTdName & " name=" & strTdName & " >"
strTmp = strTmp & strValue
strTmp = strTmp & "</td>" & chr(13) & chr(10) & "[infotd]"
strHtmlCode = Replace(strHtmlCode,"[infotd]",strTmp)
End Sub
Public Sub AddInfoTd(strValue,strTdClass)
Dim strTmp
If strTdClass = "" Then
strTmp = "<td "
Else
strTmp = "<td class=" & strTdClass
End If
strTmp = strTmp & " colspan=" & intColumn & " >"
strTmp = strTmp & strValue
strTmp = strTmp & "</td>" & chr(13) & chr(10) & "[infotd]"
strHtmlCode = Replace(strHtmlCode,"[infotd]",strTmp)
End Sub
Public Sub EndInfoTd()
strHtmlCode = Replace(strHtmlCode,"[infotd]","")
End Sub
'===================================================================
'= Description : Out table htmlcode
'= Time : Created At OCT,19,2003
'===================================================================
Public Function OutPutTable()
strHtmlCode = Replace(strHtmlCode,"[tr]","")
strHtmlCode = Replace(strHtmlCode,"[td]","")
strHtmlCode = Replace(strHtmlCode,"[titletr]","")
strHtmlCode = Replace(strHtmlCode,"[titletd]","")
strHtmlCode = Replace(strHtmlCode,"[toptr]","")
strHtmlCode = Replace(strHtmlCode,"[bottomtr]","")
strHtmlCode = Replace(strHtmlCode,"[infotd]","")
strHtmlCode = Replace(strHtmlCode,"class= ","")
strHtmlCode = Replace(strHtmlCode,"class=>",">")
strHtmlCode = Replace(strHtmlCode,"width=>",">")
If intOutFlag = 0 Then
OutPutTable = ""
Response.Write strHtmlCode
ElseIf intOutFlag = 2 Then
OutPutTable = strHtmlCode
Response.Write strHtmlCode
Else
OutPutTable = strHtmlCode
End If
End Function
Public Sub Clear()
strBorder = "0"
strPadding = "0"
strSpacing = "0"
strWidth = "0"
strAlign = "center"
strValign = "middle"
strClass = "TBone1"
intColumn = 0
strPostFile = "./"
strTrScale = "100%"
intOutFlag = 0
End Sub
End Class
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -