asp.net.ph

HtmlTable.Border Property

System.Web.UI.HtmlControls Namespace   HtmlTable Class


Sets or retrieves the border width of an HtmlTable control.

Syntax


Inline <table border = intWidth ... >
Script HtmlTable.Border [ = intWidth ]

Property Value


intWidth Integer specifying the width of the border, in pixels.

This property is read/write with a default value of -1 ( not set ).

Remarks

Border is used to specify how wide the border of an HtmlTable control is to be rendered. This property must evaluate to a positive value.

If you do not need a border for the HtmlTable, set this property to either 0 ( no border width ) or simply exclude the property from the declaration.

Border can only be expressed in pixels.

Example

The following example shows how to declaratively set the Border property of an HtmlTable control at design time.

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

<tr>
   <td>Table data</td></tr>
</table>

The example below demonstrates how to programmatically set the Border property at run time, depending on user input.

void Page_Load ( object Source, EventArgs e ) {
   if ( !IsPostBack ) {
      for ( int i=5; i<=30; i+=5 ) {
         widthSelect.Items.Add ( i.ToString ( ) );
      }
      widthSelect.Value = "5";
   }
   myTable.Border = int.Parse ( widthSelect.Value );
}

 Show me 

See Also

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