This class provides a powerful way to access the HTML <table> element. You can also use it to dynamically generate an HTML table by adding HtmlTableRow objects to the Rows collection and adding HtmlTableCell objects to each row. Programmatically created tables must be recreated with every postback.
Most other properties for the HtmlTable class correspond to formatting options, including the background color (BgColor), alignment (Align), and dimensions (Height and Width). You can also set values in pixels for the width of the border around the table (Border), the spacing between cells (CellSpacing), and the spacing between cell borders and content (CellPadding).
public class HtmlTable : HtmlContainerControl { // Public Constructors public HtmlTable( ); // Public Instance Properties public string Align{set; get; } public string BgColor{set; get; } public int Border{set; get; } public string BorderColor{set; get; } public int CellPadding{set; get; } public int CellSpacing{set; get; } public string Height{set; get; } public override string InnerHtml{set; get; } // overrides HtmlContainerControl public override string InnerText{set; get; } // overrides HtmlContainerControl public virtual HtmlTableRowCollection Rows{get; } public string Width{set; get; } // Protected Instance Methods protected override ControlCollection CreateControlCollection( ); // overrides HtmlContainerControl protected override void RenderChildren(System.Web.UI.HtmlTextWriter writer); // overrides System.Web.UI.Control protected override void RenderEndTag(System.Web.UI.HtmlTextWriter writer); // overrides HtmlContainerControl }