Windows Dev Center

all
alt
ch
dir
id
min
rel
top
url
URL
urn
Expand Minimize

cols attribute | cols property

Sets or retrieves the number of columns in the table.

Syntax

HTML<element cols="nColumns" ... >
JavaScript

nColumns = object.cols

 

Property values

Type: Integer

the number of columns.

Standards information

Remarks

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

Examples

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 type="text/javascript">
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>

See also

table

 

 

Show:
© 2015 Microsoft