System.Web.UI.HtmlControls Namespace
Allows programmatic access to the HTML <table> element on the server.
Visibility |
Constructor |
Parameters |
public |
HtmlTable |
( )
|
Visibility |
Name |
Value Type |
Accessibility |
public |
Align
|
String |
[ Get , Set ] |
public |
BgColor
|
String |
[ Get , Set ] |
public |
Border
|
Int32 |
[ Get , Set ] |
public |
BorderColor
|
String |
[ Get , Set ] |
public |
CellPadding
|
Int32 |
[ Get , Set ] |
public |
CellSpacing
|
Int32 |
[ Get , Set ] |
public |
Height
|
String |
[ Get , Set ] |
public |
InnerHtml
|
String |
[ Get , Set ] |
public |
InnerText
|
String |
[ Get , Set ] |
public |
Rows
|
HtmlTableRowCollection |
[ Get ] |
public |
Width
|
String |
[ Get , Set ] |
|
Use the HtmlTable control to programmatically generate an HTML <table> element on a Web page.
You can dynamically change the appearance of the <table> element by setting the BgColor, Border, BorderColor, Height, and Width properties. You can also control how the content of a cell is displayed by setting the Align, CellPadding, and CellSpacing properties.
NOTE: Setting some properties of a table affects all rows, and consequently, all cells in the given table. To set individual row and cell properties, use the properties applicable to the HtmlTableRow and HtmlTableCell classes.
The rows of the HtmlTable control are stored in the Rows collection. This allows you to programmatically access the properties, as well as the content, of each row in the table.
A complex table model is not supported. You cannot have an HtmlTable control that nests <caption>, <col>, <colgroup>, <tbody>, <thead>, or <tfoot> elements. These elements will be removed without warning and will not appear in the output HTML.
CAUTION: Attempting to programmatically add these complex table model elements to the Controls collection of the HtmlTable will raise an exception.
For examples illustrating use of this control, see the individual member types of this class. For syntax information, see HtmlTable in ASP.NET Syntax for HTML Controls.
HtmlContainerControl HtmlTableCell HtmlTableCellCollection HtmlTableRow HtmlTableRowCollection