HtmlTable Class
Allows programmatic access on the server to the HTML <table> element.
Assembly: System.Web (in System.Web.dll)
[AspNetHostingPermissionAttribute(SecurityAction::LinkDemand, Level = AspNetHostingPermissionLevel::Minimal)] [AspNetHostingPermissionAttribute(SecurityAction::InheritanceDemand, Level = AspNetHostingPermissionLevel::Minimal)] public ref class HtmlTable : public HtmlContainerControl
<asp:HtmlTable />
Use the HtmlTable control to programmatically control the HTML <table> element on the server. This allows you to create a table 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.
The rows of the HtmlTable control are stored in the Rows property of the control. This allows you to programmatically access the individual rows of the table.
Note: |
|---|
A complex table model is not supported. You cannot have an HtmlTable control with nested <caption>, <col>, <colgroup>, <tbody>, <thead>, or <tfoot> elements. These elements are removed without warning and do not appear in the output HTML. An exception will be thrown if you attempt to programmatically add these table model elements to the Control::Controls collection of the HtmlTable control. |
For a list of initial property values for an instance of HtmlTable, see the HtmlTable constructor.
| Topic | Location |
|---|---|
| How to: Add HTML Server Controls to a Web Page Using ASP.NET Syntax | Building ASP .NET Web Applications |
| How to: Add Rows and Cells Dynamically to a Table Web Server Control | Building ASP .NET Web Applications |
| How to: Set HTML Server Control Properties Programmatically | Building ASP .NET Web Applications |
| How to: Add HTML Server Controls to a Web Page Using ASP.NET Syntax | Building ASP .NET Web Applications |
| How to: Add Rows and Cells Dynamically to a Table Web Server Control | Building ASP .NET Web Applications |
| How to: Set HTML Server Control Properties Programmatically | Building ASP .NET Web Applications |
| How to: Create and Edit HTML Tables in Design View | Building ASP .NET Web Applications in Visual Studio |
| How to: Select HTML Table Elements and Contents in Visual Web Developer | Building ASP .NET Web Applications in Visual Studio |
| How to: Resize HTML Table Elements in Visual Web Developer | Building ASP .NET Web Applications in Visual Studio |
- AspNetHostingPermission
for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
- AspNetHostingPermission
for operating in a hosted environment. Demand value: InheritanceDemand; Permission value: Minimal.
System.Web.UI::Control
System.Web.UI.HtmlControls::HtmlControl
System.Web.UI.HtmlControls::HtmlContainerControl
System.Web.UI.HtmlControls::HtmlTable
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note: