F
fniles
I am using System.web.ui.webcontrols.table in my ASPX page. I then populate
the table with data from a database.
Since below the table I have some other controls, I would like the table to
be only certain height.
How can I do that ?
Thank you.
From myPage.aspx:
<asp:Table id="MyTbl" style="Z-INDEX: 101; LEFT: 16px; POSITION: absolute;
TOP: 56px" runat="server"></asp:Table>
From myPage.aspx.vb:
Dim tableStyle As New TableItemStyle
Dim tempRow As New TableRow
Dim aRow As System.Data.DataRow
tableStyle.VerticalAlign = VerticalAlign.Middle
tableStyle.Font.Name = "Arial"
'read from database
For Each aRow In rs.Rows
Dim Row As New TableRow
AddOtherCell(Row, rs.Fields("ERP-SOFTWARE1", lRow), 0, 0, Color.White,
1000, False)
myTbl.Rows.Add(Row)
lRow = lRow + 1
Next
Public Sub AddOtherCell(ByRef tempRow As TableRow, ByVal sText As String,
ByVal iRowSpan As Integer, ByVal iColSpan As Integer, _
ByVal sBackColor As Color, ByVal iWidth As Integer, ByVal bBold As Boolean)
Dim tempCell As New TableCell
tempCell.Text = sText
tempCell.BackColor = sBackColor
tempCell.Width = iWidth
tempRow.Cells.Add(tempCell)
End Sub
the table with data from a database.
Since below the table I have some other controls, I would like the table to
be only certain height.
How can I do that ?
Thank you.
From myPage.aspx:
<asp:Table id="MyTbl" style="Z-INDEX: 101; LEFT: 16px; POSITION: absolute;
TOP: 56px" runat="server"></asp:Table>
From myPage.aspx.vb:
Dim tableStyle As New TableItemStyle
Dim tempRow As New TableRow
Dim aRow As System.Data.DataRow
tableStyle.VerticalAlign = VerticalAlign.Middle
tableStyle.Font.Name = "Arial"
'read from database
For Each aRow In rs.Rows
Dim Row As New TableRow
AddOtherCell(Row, rs.Fields("ERP-SOFTWARE1", lRow), 0, 0, Color.White,
1000, False)
myTbl.Rows.Add(Row)
lRow = lRow + 1
Next
Public Sub AddOtherCell(ByRef tempRow As TableRow, ByVal sText As String,
ByVal iRowSpan As Integer, ByVal iColSpan As Integer, _
ByVal sBackColor As Color, ByVal iWidth As Integer, ByVal bBold As Boolean)
Dim tempCell As New TableCell
tempCell.Text = sText
tempCell.BackColor = sBackColor
tempCell.Width = iWidth
tempRow.Cells.Add(tempCell)
End Sub