Style columnCountProperty

Style 对象参考手册Style Object

Examples

Divide the text in the div element into three columns:

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

Try it Yourself »

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, MozColumnCount.

Safari and Chrome support an alternative property, WebkitColumnCount.

Note:Internet Explorer 9 and 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"

Property 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. Seeinitial。
inherit Inherits this property from its parent element. Seeinherit。

Technical Details

Default Value: auto
Return Value: A string representing the column-count property of an element.
CSS Version CSS3


Related Articles

CSS3 Tutorial:CSS3 Multiple Columns

CSS Reference:column-count property


Style 对象参考手册Style Object

Other Extensions