ASP.NET Syntax ASP.NET Syntax for Web Controls
The Table control allows you to declare a table and manipulate it programmatically.
Declarative Syntax
<asp:Table
AccessKey = "string"
BackColor = "color name | #dddddd"
BackImageUrl = "uri"
BorderColor = "color name | #dddddd"
BorderStyle = "NotSet | None | Dotted | Dashed | Solid | Double | Groove |
Ridge | Inset | Outset"
BorderWidth = size
Caption = "string"
CaptionAlign = "NotSet | Top | Bottom | Left | Right"
CellPadding = integer
CellSpacing = integer
CssClass = "string"
Enabled = "True | False"
EnableTheming = "True | False"
EnableViewState = "True | False"
Font-Bold = "True | False"
Font-Italic = "True | False"
Font-Names = "string"
Font-Overline = "True | False"
Font-Size = "string | Smaller | Larger | XX-Small | X-Small | Small |
Medium | Large | X-Large | XX-Large"
Font-Strikeout = "True | False"
Font-Underline = "True | False"
ForeColor = "color name | #dddddd"
GridLines = "None | Horizontal | Vertical | Both"
Height = size
HorizontalAlign = "NotSet | Left | Center | Right | Justify"
ID = "string"
OnDataBinding = "DataBinding event handler"
OnDisposed = "Disposed event handler"
OnInit = "Init event handler"
OnLoad = "Load event handler"
OnPreRender = "PreRender event handler"
OnUnload = "Unload event handler"
runat = "server"
SkinID = "string"
Style = "string"
TabIndex = integer
ToolTip = "string"
Visible = "True | False"
Width = size
>
<asp:TableFooterRow
AccessKey = "string"
BackColor = "color name | #dddddd"
BorderColor = "color name | #dddddd"
BorderStyle = "NotSet | None | Dotted | Dashed | Solid | Double |
Groove | Ridge | Inset | Outset"
BorderWidth = size
CssClass = "string"
Enabled = "True | False"
EnableTheming = "True | False"
EnableViewState = "True | False"
Font-Bold = "True | False"
Font-Italic = "True | False"
Font-Names = "string"
Font-Overline = "True | False"
Font-Size = "string | Smaller | Larger | XX-Small | X-Small |
Small | Medium | Large | X-Large | XX-Large"
Font-Strikeout = "True | False"
Font-Underline = "True | False"
ForeColor = "color name | #dddddd"
Height = size
HorizontalAlign = "NotSet | Left | Center | Right | Justify"
ID = "string"
OnDataBinding = "DataBinding event handler"
OnDisposed = "Disposed event handler"
OnInit = "Init event handler"
OnLoad = "Load event handler"
OnPreRender = "PreRender event handler"
OnUnload = "Unload event handler"
runat = "server"
SkinID = "string"
Style = "string"
TabIndex = integer
TableSection = "TableHeader | TableBody | TableFooter"
ToolTip = "string"
VerticalAlign = "NotSet | Top | Middle | Bottom"
Visible = "True | False"
Width = size
>
<asp:TableCell
AccessKey = "string"
AssociatedHeaderCellID = "string"
BackColor = "color name | #dddddd"
BorderColor = "color name | #dddddd"
BorderStyle = "NotSet | None | Dotted | Dashed |
Solid | Double | Groove | Ridge | Inset |
Outset"
BorderWidth = size
ColumnSpan = integer
CssClass = "string"
Enabled = "True | False"
EnableTheming = "True | False"
EnableViewState = "True | False"
Font-Bold = "True | False"
Font-Italic = "True | False"
Font-Names = "string"
Font-Overline = "True | False"
Font-Size = "string | Smaller | Larger |
XX-Small | X-Small | Small | Medium | Large |
X-Large | XX-Large"
Font-Strikeout = "True | False"
Font-Underline = "True | False"
ForeColor = "color name | #dddddd"
Height = size
HorizontalAlign = "NotSet | Left | Center |
Right | Justify"
ID = "string"
OnDataBinding = "DataBinding event handler"
OnDisposed = "Disposed event handler"
OnInit = "Init event handler"
OnLoad = "Load event handler"
OnPreRender = "PreRender event handler"
OnUnload = "Unload event handler"
RowSpan = integer
runat = "server"
SkinID = "string"
Style = "string"
TabIndex = integer
Text = "string"
ToolTip = "string"
VerticalAlign = "NotSet | Top | Middle | Bottom"
Visible = "True | False"
Width = size
Wrap = "True | False"
/>
<asp:TableHeaderCell
AbbreviatedText = "string"
AccessKey = "string"
AssociatedHeaderCellID = "string"
BackColor = "color name | #dddddd"
BorderColor = "color name | #dddddd"
BorderStyle = "NotSet | None | Dotted | Dashed |
Solid | Double | Groove | Ridge | Inset |
Outset"
BorderWidth = size
CategoryText = "string"
ColumnSpan = integer
CssClass = "string"
Enabled = "True | False"
EnableTheming = "True | False"
EnableViewState = "True | False"
Font-Bold = "True | False"
Font-Italic = "True | False"
Font-Names = "string"
Font-Overline = "True | False"
Font-Size = "string | Smaller | Larger |
XX-Small | X-Small | Small | Medium | Large |
X-Large | XX-Large"
Font-Strikeout = "True | False"
Font-Underline = "True | False"
ForeColor = "color name | #dddddd"
Height = size
HorizontalAlign = "NotSet | Left | Center |
Right | Justify"
ID = "string"
OnDataBinding = "DataBinding event handler"
OnDisposed = "Disposed event handler"
OnInit = "Init event handler"
OnLoad = "Load event handler"
OnPreRender = "PreRender event handler"
OnUnload = "Unload event handler"
RowSpan = integer
runat = "server"
Scope = "NotSet | Row | Column"
SkinID = "string"
Style = "string"
TabIndex = integer
Text = "string"
ToolTip = "string"
VerticalAlign = "NotSet | Top | Middle | Bottom"
Visible = "True | False"
Width = size
Wrap = "True | False"
/>
</asp:TableFooterRow>
<asp:TableHeaderRow
AccessKey = "string"
BackColor = "color name | #dddddd"
BorderColor = "color name | #dddddd"
BorderStyle = "NotSet | None | Dotted | Dashed | Solid | Double |
Groove | Ridge | Inset | Outset"
BorderWidth = size
CssClass = "string"
Enabled = "True | False"
EnableTheming = "True | False"
EnableViewState = "True | False"
Font-Bold = "True | False"
Font-Italic = "True | False"
Font-Names = "string"
Font-Overline = "True | False"
Font-Size = "string | Smaller | Larger | XX-Small | X-Small |
Small | Medium | Large | X-Large | XX-Large"
Font-Strikeout = "True | False"
Font-Underline = "True | False"
ForeColor = "color name | #dddddd"
Height = size
HorizontalAlign = "NotSet | Left | Center | Right | Justify"
ID = "string"
OnDataBinding = "DataBinding event handler"
OnDisposed = "Disposed event handler"
OnInit = "Init event handler"
OnLoad = "Load event handler"
OnPreRender = "PreRender event handler"
OnUnload = "Unload event handler"
runat = "server"
SkinID = "string"
Style = "string"
TabIndex = integer
TableSection = "TableHeader | TableBody | TableFooter"
ToolTip = "string"
VerticalAlign = "NotSet | Top | Middle | Bottom"
Visible = "True | False"
Width = size
>
<asp:TableCell
AccessKey = "string"
AssociatedHeaderCellID = "string"
BackColor = "color name | #dddddd"
BorderColor = "color name | #dddddd"
BorderStyle = "NotSet | None | Dotted | Dashed |
Solid | Double | Groove | Ridge | Inset |
Outset"
BorderWidth = size
ColumnSpan = integer
CssClass = "string"
Enabled = "True | False"
EnableTheming = "True | False"
EnableViewState = "True | False"
Font-Bold = "True | False"
Font-Italic = "True | False"
Font-Names = "string"
Font-Overline = "True | False"
Font-Size = "string | Smaller | Larger |
XX-Small | X-Small | Small | Medium | Large |
X-Large | XX-Large"
Font-Strikeout = "True | False"
Font-Underline = "True | False"
ForeColor = "color name | #dddddd"
Height = size
HorizontalAlign = "NotSet | Left | Center |
Right | Justify"
ID = "string"
OnDataBinding = "DataBinding event handler"
OnDisposed = "Disposed event handler"
OnInit = "Init event handler"
OnLoad = "Load event handler"
OnPreRender = "PreRender event handler"
OnUnload = "Unload event handler"
RowSpan = integer
runat = "server"
SkinID = "string"
Style = "string"
TabIndex = integer
Text = "string"
ToolTip = "string"
VerticalAlign = "NotSet | Top | Middle | Bottom"
Visible = "True | False"
Width = size
Wrap = "True | False"
/>
<asp:TableHeaderCell
AbbreviatedText = "string"
AccessKey = "string"
AssociatedHeaderCellID = "string"
BackColor = "color name | #dddddd"
BorderColor = "color name | #dddddd"
BorderStyle = "NotSet | None | Dotted | Dashed |
Solid | Double | Groove | Ridge | Inset |
Outset"
BorderWidth = size
CategoryText = "string"
ColumnSpan = integer
CssClass = "string"
Enabled = "True | False"
EnableTheming = "True | False"
EnableViewState = "True | False"
Font-Bold = "True | False"
Font-Italic = "True | False"
Font-Names = "string"
Font-Overline = "True | False"
Font-Size = "string | Smaller | Larger |
XX-Small | X-Small | Small | Medium | Large |
X-Large | XX-Large"
Font-Strikeout = "True | False"
Font-Underline = "True | False"
ForeColor = "color name | #dddddd"
Height = size
HorizontalAlign = "NotSet | Left | Center |
Right | Justify"
ID = "string"
OnDataBinding = "DataBinding event handler"
OnDisposed = "Disposed event handler"
OnInit = "Init event handler"
OnLoad = "Load event handler"
OnPreRender = "PreRender event handler"
OnUnload = "Unload event handler"
RowSpan = integer
runat = "server"
Scope = "NotSet | Row | Column"
SkinID = "string"
Style = "string"
TabIndex = integer
Text = "string"
ToolTip = "string"
VerticalAlign = "NotSet | Top | Middle | Bottom"
Visible = "True | False"
Width = size
Wrap = "True | False"
/>
</asp:TableHeaderRow>
<asp:TableRow
AccessKey = "string"
BackColor = "color name | #dddddd"
BorderColor = "color name | #dddddd"
BorderStyle = "NotSet | None | Dotted | Dashed | Solid | Double |
Groove | Ridge | Inset | Outset"
BorderWidth = size
CssClass = "string"
Enabled = "True | False"
EnableTheming = "True | False"
EnableViewState = "True | False"
Font-Bold = "True | False"
Font-Italic = "True | False"
Font-Names = "string"
Font-Overline = "True | False"
Font-Size = "string | Smaller | Larger | XX-Small |
X-Small | Small | Medium | Large | X-Large | XX-Large"
Font-Strikeout = "True | False"
Font-Underline = "True | False"
ForeColor = "color name | #dddddd"
Height = size
HorizontalAlign = "NotSet | Left | Center | Right | Justify"
ID = "string"
OnDataBinding = "DataBinding event handler"
OnDisposed = "Disposed event handler"
OnInit = "Init event handler"
OnLoad = "Load event handler"
OnPreRender = "PreRender event handler"
OnUnload = "Unload event handler"
runat = "server"
SkinID = "string"
Style = "string"
TabIndex = integer
TableSection = "TableHeader | TableBody | TableFooter"
ToolTip = "string"
VerticalAlign = "NotSet | Top | Middle | Bottom"
Visible = "True | False"
Width = size
>
<asp:TableCell
AccessKey = "string"
AssociatedHeaderCellID = "string"
BackColor = "color name | #dddddd"
BorderColor = "color name | #dddddd"
BorderStyle = "NotSet | None | Dotted | Dashed |
Solid | Double | Groove | Ridge | Inset |
Outset"
BorderWidth = size
ColumnSpan = integer
CssClass = "string"
Enabled = "True | False"
EnableTheming = "True | False"
EnableViewState = "True | False"
Font-Bold = "True | False"
Font-Italic = "True | False"
Font-Names = "string"
Font-Overline = "True | False"
Font-Size = "string | Smaller | Larger |
XX-Small | X-Small | Small | Medium | Large |
X-Large | XX-Large"
Font-Strikeout = "True | False"
Font-Underline = "True | False"
ForeColor = "color name | #dddddd"
Height = size
HorizontalAlign = "NotSet | Left | Center |
Right | Justify"
ID = "string"
OnDataBinding = "DataBinding event handler"
OnDisposed = "Disposed event handler"
OnInit = "Init event handler"
OnLoad = "Load event handler"
OnPreRender = "PreRender event handler"
OnUnload = "Unload event handler"
RowSpan = integer
runat = "server"
SkinID = "string"
Style = "string"
TabIndex = integer
Text = "string"
ToolTip = "string"
VerticalAlign = "NotSet | Top | Middle | Bottom"
Visible = "True | False"
Width = size
Wrap = "True | False"
/>
<asp:TableHeaderCell
AbbreviatedText = "string"
AccessKey = "string"
AssociatedHeaderCellID = "string"
BackColor = "color name | #dddddd"
BorderColor = "color name | #dddddd"
BorderStyle = "NotSet | None | Dotted | Dashed |
Solid | Double | Groove | Ridge | Inset |
Outset"
BorderWidth = size
CategoryText = "string"
ColumnSpan = integer
CssClass = "string"
Enabled = "True | False"
EnableTheming = "True | False"
EnableViewState = "True | False"
Font-Bold = "True | False"
Font-Italic = "True | False"
Font-Names = "string"
Font-Overline = "True | False"
Font-Size = "string | Smaller | Larger |
XX-Small | X-Small | Small | Medium | Large |
X-Large | XX-Large"
Font-Strikeout = "True | False"
Font-Underline = "True | False"
ForeColor = "color name | #dddddd"
Height = size
HorizontalAlign = "NotSet | Left | Center |
Right | Justify"
ID = "string"
OnDataBinding = "DataBinding event handler"
OnDisposed = "Disposed event handler"
OnInit = "Init event handler"
OnLoad = "Load event handler"
OnPreRender = "PreRender event handler"
OnUnload = "Unload event handler"
RowSpan = integer
runat = "server"
Scope = "NotSet | Row | Column"
SkinID = "string"
Style = "string"
TabIndex = integer
Text = "string"
ToolTip = "string"
VerticalAlign = "NotSet | Top | Middle | Bottom"
Visible = "True | False"
Width = size
Wrap = "True | False"
/>
</asp:TableRow>
</asp:Table>
For information on the individual members of this class, see Table in the class library.
The Table class allows you to build an HTML table and specify its characteristics. A table can be built at design time with static content, but the Table control is often built programmatically with dynamic contents.
NOTE: Programmatic additions or modifications to a table row or cell will not persist across posts to the server. Table rows and cells are controls of their own, and not properties of the Table control. Changes to table rows or cells must be reconstructed after each post to the server. If substantial modifications are expected, use the DataList or DataGrid controls instead of the Table control.
Table Class Table, TableRow, and TableCell Web Server Controls