System.Web.UI.HtmlControls Namespace HtmlTableRow Class
Sets or retrieves the vertical alignment of content in the cells of a row.
Inline |
<tr valign = 'top' | 'middle' | 'bottom' ... > |
Script |
HtmlTableRow.VAlign [ = 'top' | 'middle' | 'bottom' ] |
A string specifying the vertical position of content within the table row.
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.
Use the VAlign property to specify the vertical position of the content in an HtmlTableRow class.
Setting this property affects all cells in a row. To apply vertical alignment to a single cell, set the VAlign property for that cell instead.
To apply the same vertical alignment to all rows of an entire table, you can loop thru each row using the Rows collection.
The below snippet shows how to declaratively set the VAlign property of a table row at design time.
<table cellspacing=1 width="92%" border=1 runat="server">
<tr valign="top">
<td>Table data cell 1</td>
<td>Table data cell 2</td>
</tr>
</table>
The following example demonstrates how to programmatically set the vertical alignment of the contents of each row in an HtmlTable control.
Show me
HtmlTableRow Members Align