ASP.NET VerticalAlign 属性

定义和用法

VerticalAlign 属性用于设置或返回 TableCell 控件中内容的垂直对齐方式。

语法

<asp:TableCell VerticalAlign="align" runat="server">
Some Content
</asp:TableCell>
属性 描述
align

规定内容的垂直对齐方式。

可能的值:

  • Bottom
  • Middle
  • NotSet
  • Top

实例

下面的例子设置了 TableCell 控件的 VerticalAlign 属性:

<form runat="server">
<asp:Table id="tab1" runat="server">
<asp:TableRow>
<asp:TableCell VerticalAlign="Center">Hello!</asp:TableCell>
<asp:TableCell>Hello!</asp:TableCell>
</asp:TableRow>
</asp:Table>
</form>

实例

为 TableCell 控件设置垂直对齐方式