English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag Directory

HTML: <textarea> cols attribute

The cols attribute specifies the visible width of the text area. The size of textarea can also be set through CSS height and width properties.

 HTML <textarea> tag

Online Example

Specify both the height and width of textarea at the same time:

Example4<textarea rows="5" cols="
0">3At w
</textarea>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the cols attribute.

Definition and Usage

The cols attribute specifies the visible width of the text area.

Note:The size of the textarea can also be set using the CSS height and width properties.

HTML 4.01 and HTML5The difference between

None.

Syntax

<textarea cols="number">

Attribute Value

ValueDescription
numberSpecify the width of the text area (in average character width units). The default value is20.
 HTML <textarea> tag