www.fgks.org   »   [go: up one dir, main page]

Click to Rate and Give Feedback
Properties
 cols Property
COLS Attribute | cols Property

Sets or retrieves the number of columns in the table.

Syntax

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

Possible Values

iCountInteger that specifies or receives the number of columns.

The property is read/write. The property has no default value.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see About 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.

<SCRIPT>
function checkCols(oObject)
{
    var iColumns = oObject.cols;
    alert (iColumns);
}
</SCRIPT>
</HEAD>
<BODY>
<TABLE ID=oTable BORDER COLS=3 >
<TR><TD>Column 1</TD><TD>Column 2</TD><TD>Column 3</TD></TR>
</TABLE>
This feature requires Microsoft® Internet Explorer 4.0 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Standards Information

This property is a Microsoft extension to HTML World Wide Web link and is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 World Wide Web link.

Applies To

TABLE
Tags What's this?: Add a tag
Community Content
 
Add Community Content
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker
DCSIMG