You are here: Reference > HTML > attributes > cols (table)

cols attribute (table)

Browser support:
Specifies the number of columns in a table.
This attribute is only useful to speed up the browser's rendering mechanism.
JavaScript page for this attribute: cols. You can find other example(s) there.

Possible values:

Integer that sets the number of columns.
Default: this attribute has no default value.

Example HTML code 1:

This example illustrates the use of the cols attribute:
<table border="3px" cols="3" id="myTable">
    <tr>
        <td>Apple</td>
        <td>Pear</td>
        <td>Peach</td>
    </tr>
</table>
Did you find this example helpful? yes no

Supported by tags:

External links:

User Contributed Comments

Post Content

Post Content