Question about table control


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
 
Ad

Advertisements

B

bruce barker

in html, only the <table> and <td> support css sizing, so in a table,
use the TableCell CssClass or Style to set size properties. if you want
a certian size, you need to specify an overflow behavior that will honor it.

-- bruce (sqlwork.com)
 
Ad

Advertisements

F

fniles

Thank you.

So I can do something like: tempCell.Style.Add("height", "100") ?
But that only sized the cell, how about the table itself ? I don't want the
table to pass a certain height.
if you want a certian size, you need to specify an overflow behavior that
will honor it.
what do you mean by overflow behavior ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top