asp.net.ph

TableCell.VerticalAlign Property

System.Web.UI.WebControls Namespace   TableCell Class


Sets or retrieves the vertical alignment of content within a table cell.

Syntax


Inline <asp:tablecell valign = enumValue ... >
Script TableCell.VerticalAlign [ = enumValue ]

Property Value


enumValue One of the VerticalAlign enum values.

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

Remarks

Use the VerticalAlign property to specify the vertical position of the content in a TableCell 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 VerticalAlign property of the TableRow.

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 VerticalAlign property of a table cell at design time.

<asp:table cellspacing=1 width = "92%" runat = "server">
   <asp:tablerow>
      <asp:tableheadercell>Table header</asp:tableheadercell>
   </asp:tablerow>

   <asp:tablerow>
      <asp:tablecell verticalalign = "middle">Table data</asp:tablecell>
   </asp:tablerow>
</asp:table>

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

 Show me 

See Also

TableCell Members   HorizontalAlign 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