共用方式為


TableHeaderCell 建構函式

定義

初始化 TableHeaderCell 類別的新執行個體。

public:
 TableHeaderCell();
public TableHeaderCell ();
Public Sub New ()

範例

下列範例示範如何以程式設計方式將控制項新增 TableHeaderCell 至網頁。 如需完整的運作程式碼範例,請參閱 TableRow 類別概觀主題。

// 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);  
' Create a header for the table.
Dim header As 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.
Dim headerRow As New TableRow()
headerRow.Cells.Add(header)

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

備註

使用此建構函式來建立和初始化 類別的新實例 TableHeaderCell

適用於