Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style columnCount Property

Style columnCount Property

Style Object Reference The Style object

Example

Divide the text in a div element into three columns:

document.getElementById("myDIV").style.columnCount=3;

Try it »


Definition and Usage

The columnCount property specifies the number of columns an element should be divided into.


Browser support

Internet Explorer Firefox Opera Google Chrome Safari

Internet Explorer 10 and Opera support the columnCount property.

Firefox supports an alternative property to this one, namely the MozColumnCount property.

Safari and Chrome support an alternative property to this one, namely the WebkitColumnCount property.

**Note:** Internet Explorer 9 and its earlier versions do not support the columnCount property.


Syntax

Return the columnCount property:

object

.style.columnCount

Set the columnCount property:

object

.style.columnCount="

number

|auto|initial|inherit"

Attribute values

Value Description
number The optimal number of columns into which the element's content will be divided.
auto Default value. The number of columns is determined by other properties, such as "column-width".
initial Sets this property to its default value. See initial.
inherit Inherits this property from its parent element. See inherit.

Technical Details

Default value: auto
Return Value: A string that represents the column-count property of an element.
CSS version CSS3

Related Articles

CSS3 Tutorial:CSS3 Multiple Columns

CSS Reference Manual:column-count property


Style Object Reference The Style object