HTML cols Attribute

❮ HTML Attributes


<form action="action.php">
	<label for="demo">textarea demo:</label>
	<textarea cols="25" id="demo" name="textareaText">
	Hello world!
	<input type="submit" value="Submit">


The cols attribute specifies the width, in characters, of the text area.

The typical default value for the size of a <textarea> tag when this attribute is not set is 20 characters.

Standard Syntax

<element cols="number">

Browser Support


Applies to:

The cols attribute can be used on the following element:

Element Attribute
<textarea> cols

Attribute Values

Value Description
number (non-negative integer) Specifies the expected maximum number of characters per line. by default, it is 20.
❮ HTML Attributes