asp.net.ph

HtmlTable.Align Property

System.Web.UI.HtmlControls Namespace   HtmlTable Class


Sets or retrieves the alignment of the HtmlTable in relation to other elements on the Web page.

Syntax


Inline <table align = 'left' | 'center' | 'right' ... >
Script HtmlTable.Align [ = 'left' | 'center' | 'right' ]

Property Value

A string that specifies the horizontal alignment of the table with respect to other elements on the Web page.

The following table lists the values that can be used for this property.

Value Description
left Aligns the HtmlTable on the left margin of the Web page. All subsequent text flows to the right of the object.
center Aligns the HtmlTable in the horizontal middle of the Web page.
right Aligns the HtmlTable on the right margin of the Web page.All subsequent text flows to the left of the object.

The property is read/write with a default value of left.

Remarks

Use the Align property to specify the alignment of the HtmlTable control in relation to other elements on the Web page.

NOTE: This property does not control the alignment of the contents in the cells of the HtmlTable control.

To control the alignment of contents of an individual cell, use the Align and VAlign properties of the HtmlTableCell class. You can also control the alignment of contents of the cells in an entire row by using the Align and VAlign properties of the HtmlTableRow class.

If you specify Left or Right alignment, other elements on the Web page will wrap to the right and left of the HtmlTable control, respectively. If you specify Center alignment, no wrapping occurs and other elements appear below the control.

Example

The below snippet shows how to declaratively set the Align property of an HtmlTable control at design time.

<table cellspacing=1 width="92%" align="center" runat="server">
<tr>
   <th>Table header</th></tr>

<tr>
   <td>Table data</td></tr>
</table>

The following example demonstrates using the Align property to programmatically set the horizontal placement of the HtmlTable at run time.

 Show me 

See Also

HtmlTable Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph