TableHeaderCell Constructor ()
.NET Framework (current version)
Initializes a new instance of the TableHeaderCell class.
Assembly: System.Web (in System.Web.dll)
Use this constructor to create and initialize a new instance of the TableHeaderCell class.
The following example demonstrates how to programmatically add a TableHeaderCell control to a Web page. For a complete, working code example, see the TableRow class overview topic.
// Create a header for the table. TableHeaderCell header = new TableHeaderCell(); header.RowSpan = 1; header.ColumnSpan = 3; header.Text = "Table of (x,y) Values"; header.Font.Bold = true; header.BackColor = Color.Gray; header.HorizontalAlign = HorizontalAlign.Center; header.VerticalAlign = VerticalAlign.Middle; // Add the header to a new row. TableRow headerRow = new TableRow(); headerRow.Cells.Add(header); // Add the header row to the table. Table1.Rows.AddAt(0, headerRow);
.NET Framework
Available since 1.1
Available since 1.1
Show: