System.Web
1.0.5000.0
2.0.0.0
Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.
System.Web.UI.WebControls.WebControl
System.Web.UI.IPostBackEventHandler
System.Web.UI.SupportsEventValidation
System.Web.UI.ParseChildren(true, "Rows")
System.ComponentModel.Designer("System.Web.UI.Design.WebControls.TableDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.IDesigner")
System.ComponentModel.DefaultProperty("Rows")
In this topic:
-
Introduction
-
Accessibility
-
Declarative Syntax
Introduction
The control allows you to build an HTML table and specify its characteristics in a straightforward manner.
A table can be built at design time given some static content, but the power of a Web server control is often realized when the table is built programmatically with dynamic contents.
If the controlRenderingCompatibilityVersion attribute of the pages element in the Web.config file is set to 3.5, the control renders a border attribute that is set to "0" on the HTML table element.
It is important to remember that any programmatic addition or modification of table rows or cells will not persist across posts to the server. This is because table rows and cells are controls of their own, and not properties of the control. To persist any changes to the table, rows and cells must be reconstructed after each postback. In fact, if substantial modifications are expected, it is recommended that a , , or control be used instead of the control. As a result, the class is primarily used by control developers.
This control can be used to display user input, which might include malicious client script. Check any information that is sent from a client for executable script, SQL statements, or other code before displaying it in your application. You can use validation controls to verify user input before displaying the input text in a control. ASP.NET provides an input request validation feature to block script and HTML in user input. For more information, see Securing Standard Controls, How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings, and Introduction to Validating User Input in ASP.NET Web Pages.
Accessibility
For information about how to configure this control so that it generates markup that conforms to accessibility standards, see Accessibility in Visual Studio 2010 and ASP.NET 4 and ASP.NET Controls and Accessibility.
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>
Displays a table on a Web page.
Constructor
Use this constructor to create and initialize a new instance of the class.
Initializes a new instance of the class.
1.0.5000.0
2.0.0.0
Method
System.Void
This method is used primarily by control developers to insert the appropriate attributes and styles into the output stream for a control. This method overrides .
Adds HTML attributes and styles that need to be rendered to the specified .
The output stream that renders HTML content to the client.
1.0.5000.0
2.0.0.0
Property
System.String
To be added: an object of type 'string'
Use the property to specify the location of an image to display in the background of the control. You can use a relative or an absolute URL. A relative URL relates the location of the image to the location of the Web page or user control without specifying a complete path on the server. The path is relative to the location of the Web page. This makes it easier to move the entire site to another directory on the server without updating the path to the image in code. An absolute URL provides the complete path, so moving the site to another directory requires updating the code.
If the image is smaller than the control, it will be tiled.
Gets or sets the URL of the background image to display behind the control.
1.0.5000.0
2.0.0.0
System.ComponentModel.DefaultValue("")
System.Web.UI.UrlProperty
System.ComponentModel.Editor("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
Property
1.0.5000.0
2.0.0.0
System.ComponentModel.Localizable(true)
System.ComponentModel.DefaultValue("")
System.String
To be added.
Use the property to specify the text to render in an HTML caption element in a control. The text that you specify provides Assistive Technology devices with a description of the table that can be used to make the control more accessible.
Additional accessibility support for the control is provided by the property. Use the property to specify the alignment of the HTML caption element in a control.
The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see and ASP.NET Globalization and Localization.
Gets or sets the text to render in an HTML caption element in a control. This property is provided to make the control more accessible to users of Assistive Technology devices.
Property
1.0.5000.0
2.0.0.0
System.ComponentModel.DefaultValue(System.Web.UI.WebControls.TableCaptionAlign.NotSet)
System.Web.UI.WebControls.TableCaptionAlign
To be added.
Use the property to specify the horizontal or vertical position of the HTML caption element in a control. This property is provided to make the control more accessible to users of Assistive Technology devices.
This property is set using one of the enumeration values. The following table lists the possible values.
-
Value
Description
-
NotSet
The caption element's alignment is not set.
-
Top
The caption element is aligned with the top of the table.
-
Bottom
The caption element is aligned with the bottom of the table.
-
Left
The caption element is aligned with the left of the table.
-
Right
The caption element is aligned with the right of the table.
Additional accessibility support for the control is provided by the property. Use the property to specify the text to render in an HTML caption element in a control.
Gets or sets the horizontal or vertical position of the HTML caption element in a control. This property is provided to make the control more accessible to users of Assistive Technology devices.
Property
System.Int32
To be added: an object of type 'int'
Use the property to control the spacing between the contents of a cell and the cell's border. The padding amount specified is added to all four sides of the cell.
All cells in the same column of a control have the same width. The padding amount is applied to the widest cell and all other cells in the column have this cell width.
Similarly, all cells in the same row have the same height. The padding amount is applied to the tallest cell in the row and all other cells in the row have this cell height. Individual cell sizes cannot be specified.
Gets or sets the amount of space between the contents of a cell and the cell's border.
1.0.5000.0
2.0.0.0
System.ComponentModel.DefaultValue(-1)
Property
System.Int32
To be added: an object of type 'int'
Use the property to control the spacing between adjacent cells in the control. This spacing is applied both vertically and horizontally. The cell spacing is uniform for the entire table. Individual cell spacing between each row or column cannot be specified.
If you set this property to a value greater than 0 and set the property to a value that displays the cell borders, a gap is displayed between the borders of adjacent cells. In this situation, the property controls the size of the gap.
Gets or sets the amount of space between cells.
1.0.5000.0
2.0.0.0
System.ComponentModel.DefaultValue(-1)
Method
System.Web.UI.ControlCollection
This method is used primarily by control developers when deriving a custom class from a control.
This method overrides the implementation for the base class. For a control, the always returns a that can only contain controls of the current control.
Creates a new object to hold the controls of the current control.
A object to contain the controls of the current control.
1.0.5000.0
2.0.0.0
Method
System.Web.UI.WebControls.Style
This method is used primarily by control developers when deriving a custom control from the class.
Gets a reference to a collection of properties that define the appearance of a control.
A reference to the object that contains the properties that define the appearance of the control.
1.0.5000.0
2.0.0.0
Property
System.Web.UI.WebControls.GridLines
To be added: an object of type 'GridLines'
Use the property to specify which cell borders are displayed in the control. The following table lists the different grid line styles.
-
GridLine value
Description
-
None
No cell borders are displayed.
-
Horizontal
Only the horizontal cell borders are displayed.
-
Vertical
Only the vertical cell borders are displayed.
-
Both
Both the horizontal and vertical cell borders are displayed.
Gets or sets the grid line style to display in the control.
1.0.5000.0
2.0.0.0
System.ComponentModel.DefaultValue(System.Web.UI.WebControls.GridLines.None)
Property
System.Web.UI.WebControls.HorizontalAlign
To be added: an object of type 'HorizontalAlign'
Use the property to specify the horizontal alignment of the control within the page. The following table lists the different horizontal alignment styles.
-
HorizontalAlign value
Description
-
NotSet
The horizontal alignment of the control has not been set.
-
Left
The control is left justified on the page.
-
Center
The control is centered on the page.
-
Right
The control is right justified on the page.
-
Justify
The control is aligned with both the left and right margins of the page.
Gets or sets the horizontal alignment of the control on the page.
1.0.5000.0
2.0.0.0
System.ComponentModel.DefaultValue(System.Web.UI.WebControls.HorizontalAlign.NotSet)
Method
2.0.0.0
System.Void
The page passes the value of the parameter to the method.
Raises events for the control when a form is posted back to the server.
A that represents the argument for the event.
Method
1.0.5000.0
2.0.0.0
System.Void
This method is used primarily by control developers when deriving a custom class from a control.
The method renders the opening tag for the control, and renders tags for the table caption and alignment, if necessary.
Renders the HTML opening tag of the control to the specified writer.
An that represents the output stream to render HTML content on the client.
Method
System.Void
This method is used primarily by control developers when deriving a custom class from a control.
The control implements the to render the of the table.
Renders the rows in the table control to the specified writer.
An that represents the output stream to render HTML content on the client.
1.0.5000.0
2.0.0.0
Property
System.Web.UI.WebControls.TableRowCollection
To be added: an object of type 'TableRowCollection'
Use the collection to programmatically manage the objects in the control. A represents a row in the table.
This property is normally used only when building tables programmatically. At design time, it is set by declaring objects between the opening and closing tags of the control.
Gets the collection of rows in the control.
1.0.5000.0
2.0.0.0
System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerDefaultProperty)
System.ComponentModel.MergableProperty(false)
Method
2.0.0.0
System.Void
To be added.
Typically, you should use the method to raise an event for the control when a form is posted back to the server.
This method is an explicit interface member implementation. It can be used only when the instance is cast to an interface.
For a description of this member, see .