ASP.NET CaptionAlign Property

Definition and Usage

The CaptionAlign property is used to set or return the alignment of the title text for the table.

Syntax

<asp:Table Caption="text" CaptionAlign="align" runat="server">
Some Content
</asp:Table>
Property Description
align

Specify the alignment of the title text.

Possible Values:

  • NotSet - Default. The alignment of the title is not set.
  • Top - The title is displayed at the top of the table. Text is centered.
  • Bottom - The title is displayed at the bottom of the table. Text is centered.
  • Left - The title is displayed at the top of the table. Text is aligned to the left.
  • Right - The title is displayed at the top of the table. Text is aligned to the right.

Example

The following example sets the title properties of the table and arranges them at the bottom of the Table control:

<form runat="server">
<asp:Table id="tab1" runat="server" 
Caption="Table Example" CaptionAlign="bottom">
<asp:TableRow>
<asp:TableCell>
Hello!
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</form>

Example

Set Caption Alignment for Table