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

cols attribute (frameset)

Browser support:
Sets the widths of the columns within a frameSet element. All frame elements in the same column has the same width as the column.
The cols attribute not only specifies the width of the columns, but also specifies the count of the columns in the frameSet. The count of the comma-separated items in the value of the cols attribute defines the count of the columns.
The rows attribute is similar to the cols attribute, but it defines the height and the count of the rows in the frameSet.
The order of the frames is left-to-right, and top-to-bottom.
JavaScript page for this attribute: cols. You can find other example(s) there.

Possible values:

A comma-separated list that specifies the width of the columns in the current frameSet.
The width can be one of the following values:
width in pixels
Integer with or without a px (pixel) designator.
percentage
Integer higher or equal to 0 , with a % designator. The value is a percentage of the width of the frameset.
width*
Integer, followed by a '*' sign. Defines the width as a relative value. If only the '*' sign is defined, it is equivalent to the value of '1*'. After the pixel and percentage values are calculated, the rest of the space is divided among the relative values. For example, if there are two relative values: (2*, 3*) and the remaining space is 250px, than the value of '2*' represents a 100px width column, the value of '3*' represents a 150px width column.
Default: this attribute has no default value.

Example HTML code 1:

This example illustrates the use of the cols attribute:
Code
topFrame.htm
mainFrame.htm
<frameset rows="*" cols="200, *" border="10px" bordercolor="red">
    <frame src="topFrame.htm" name="topFrame" scrolling="No"/>
    <frame src="mainFrame.htm" name="mainFrame"/>
</frameset>
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content