HTML cols Attribute

❮ HTML Attributes

Example

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

Meaning

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




Status




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