Click to return to the DHTML, HTML     
COLS Attribute | cols Pro...     COLS Attribute | cols Pro...     DHTML Properties    
Web Workshop  |  DHTML, HTML & CSS

COLS Attribute | cols Property


Sets or retrieves the number of columns in the table.

Syntax

HTML<TABLE COLS = iCount ... >
Scriptingtable.cols [ = iCount ]

Possible Values

iCountInteger that specifies the number of columns.

The property is read/write with no default value.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see Dynamic Properties.

Remarks

Specifying this number can speed up the processing of the table.

Example

This example uses the COLS attribute and the cols property to set the number of columns in HTML and retrieve the number of columns in script.

Sample Code

<SCRIPT>
function checkCols(oObject)
{
    var iColumns = oObject.cols;
    alert (iColumns);
}
</SCRIPT>
</HEAD>
<BODY>
<TABLE ID=oTable BORDER COLS=3 onclick="checkCols(this)">
<TR><TD>Column 1</TD><TD>Column 2</TD><TD>Column 3</TD></TR>
</TABLE>

This feature requires Internet Explorer 4.0 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
TABLE


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.