| |||||||||
HtmlTableCell.Width PropertySystem.Web.UI.HtmlControls Namespace HtmlTableCell Class Sets or retrieves the width of an HtmlTableCell control. Syntax
Property Value
The property is read/write with no default value. RemarksUse the Width property to control the displayed width of the HtmlTableCell control. When you specify the width for a cell, all cells in the same column automatically share that width. By default, Width is expressed in pixels, but can also be expressed as a percentage of the containing object, which is the parent HtmlTable. Widths expressed as percentages are based on the horizontal space currently available, not on the natural size of the table cell. For example, if the browser window is resized, the table cell is resized accordingly. Note, though, that this property always retrieves the width in pixels. If you specify a width that is smaller than is required to display the contents of the HtmlTableCell, this property is ignored. ExampleThe below code shows how to declaratively set the Width of an HtmlTableCell at design time. <table cellspacing=1 width="92%" runat="server"> <tr> <th>Table header</th></tr> <tr> <td>Table data</td></tr> </table> The following example demonstrates how to programmatically set the Width of the first cell in the first row of an HtmlTable at run time, based on a selected value. myTable.Rows [ 0 ].Cells [ 0 ].Width = widthSelect.Value + "%"; See AlsoHtmlTableCell Members Height NoWrap |
| ||||||||
Check out related books at Amazon
© 2000-2008 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 aspxtreme