Advertisement
Home Open Editor ❯

HTML <textarea> cols Attribute

Example

<form action="action.php">
  <textarea cols="25" name="textareaText">Hello world!</textarea>

  <input type="submit" value="Submit">
</form>

Try this code ❯

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

<textarea cols="number">...</textarea>


Advertisement

Attribute Values

Value Description
number (non-negative integer) Specifies the expected maximum number of characters per line. by default, it is 20.
Home Open Editor ❯
Advertisement