asp.net.ph

HtmlTableRow.Align Property

System.Web.UI.HtmlControls Namespace   HtmlTableRow Class


Sets or retrieves the horizontal alignment of content in the cells of a row.

Syntax


Inline <tr align = 'left' | 'center' | 'right' ... >
Script HtmlTableRow.Align [ = 'left' | 'center' | 'right' ]

Property Value

A string specifying the horizontal position of content within the table row.

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

Value Description
left Aligns the contents with the left edge of the cell.
center Aligns the contents in the horizontal middle of the cell.
right Aligns the contents with the right edge of the cell.

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

Remarks

Use the Align property to specify the horizontal position of the content in an HtmlTableRow class.

Setting this property affects all cells in the row. To apply alignment to a single cell, set the Align property for that cell instead.

To apply the same horizontal alignment to all rows of an entire table, you can loop thru each row using the Rows collection.

Example

The below snippet shows how to declaratively set the Align property of a table row at design time.

<table cellspacing=1 width="92%" border=1 runat="server">
   <tr align="center">
      <td>Table data cell 1</td>
      <td>Table data cell 2</td>
   </tr>
</table>

The following example demonstrates how to programmatically set the horizontal alignment of the contents of each row in an HtmlTable control.

 Show me 

See Also

HtmlTableRow Members   VAlign 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