TableRow.VerticalAlign 屬性

定義

取得或設定資料列中內容的垂直對齊。

public:
 virtual property System::Web::UI::WebControls::VerticalAlign VerticalAlign { System::Web::UI::WebControls::VerticalAlign get(); void set(System::Web::UI::WebControls::VerticalAlign value); };
[System.ComponentModel.Bindable(true)]
public virtual System.Web.UI.WebControls.VerticalAlign VerticalAlign { get; set; }
public virtual System.Web.UI.WebControls.VerticalAlign VerticalAlign { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.VerticalAlign : System.Web.UI.WebControls.VerticalAlign with get, set
member this.VerticalAlign : System.Web.UI.WebControls.VerticalAlign with get, set
Public Overridable Property VerticalAlign As VerticalAlign

屬性值

VerticalAlign

其中一個 VerticalAlign 值。 預設值是 NotSet

屬性

範例

下列範例示範如何使用 VerticalAlign 屬性。 如需完整的運作程式碼範例,請參閱 TableRow 類別概觀主題。

// Create a TableItemStyle object that can be
// set as the default style for all cells
// in the table.
TableItemStyle tableStyle = new TableItemStyle();
tableStyle.HorizontalAlign = HorizontalAlign.Center;
tableStyle.VerticalAlign = VerticalAlign.Middle;
tableStyle.Width = Unit.Pixel(100);
' Create a TableItemStyle object that can be
' set as the default style for all cells
' in the table.
Dim tableStyle As New TableItemStyle()
tableStyle.HorizontalAlign = HorizontalAlign.Center
tableStyle.VerticalAlign = VerticalAlign.Middle
tableStyle.Width = Unit.Pixel(100)

備註

VerticalAlign使用 屬性來指定資料列內容的垂直對齊方式。 下表列出可能的值。

垂直對齊方式 描述
NotSet 未設定垂直對齊。
Top 資料列的內容會對齊資料列的頂端。
Middle 資料列的內容會對齊資料列的中間。
Bottom 資料列的內容會對齊資料列底部。

適用於

另請參閱