asp.net.ph

HtmlTable.Width Property

System.Web.UI.HtmlControls Namespace   HtmlTable Class


Sets or retrieves the width of an HtmlTable control.

Syntax


Inline <table width = intWidth | %Width ... >
Script HtmlTable.Width [ = intWidth | %Width ]

Property Value


intWidth Integer specifying the object width, in pixels.
%Width Value expressed as a percentage of the parent object's width.

The property is read/write with no default value.

Remarks

Use the Width property to control the displayed width of the HtmlTable control.

By default, Width is expressed in pixels, but can also be expressed as a percentage of the containing object, which typically is the page. Widths expressed as percentages are based on the horizontal space currently available, not on the natural size of the table. For example, if the browser window is resized, the table 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 HtmlTable, this property is ignored.

Example

The below code shows how to declaratively set the Width property of an HtmlTable control 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 control the Width of an HtmlTable control at run time.

 Show me 

See Also

HtmlTable Members   Height 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