Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

TableHeaderCell Constructor

Initializes a new instance of the TableHeaderCell class.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

public TableHeaderCell ()
public TableHeaderCell ()
public function TableHeaderCell ()

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();

// Add the header row to the table.
Table1.Rows.AddAt(0, headerRow);  

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

© 2015 Microsoft