asp.net.ph

HtmlTableCell.VAlign Property

System.Web.UI.HtmlControls Namespace   HtmlTableCell Class


Sets or retrieves the vertical alignment of content within an HtmlTableCell control.

Syntax


Inline <th | td valign = 'top' | 'middle' | 'bottom' ... >
Script HtmlTableCell.VAlign [ = 'top' | 'middle' | 'bottom' ]

Property Value

A string specifying the vertical position of content within the table cell.

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

Value Description
top Aligns the contents with the upper edge of the cell.
middle Aligns the contents in the vertical center of the cell.
right Aligns the contents with the lower edge of the cell.

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

Remarks

Use the VAlign property to specify the vertical position of the content in an HtmlTableCell class.

Setting this property affects only the individual cell. To apply the same alignment to the cells of an entire row in the table, set the VAlign property of the HtmlTableRow.

To apply the same horizontal alignment to all cells of an entire table, you can loop thru each cell in each row using the Cells and Rows collection.

Example

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

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

<tr>
   <td valign="middle">Table data</td></tr>
</table>

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

 Show me 

See Also

HtmlTableCell Members   Align 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