HTML <textarea> cols Attribute

The cols attribute on a textarea tag sets the width of the textarea in number of characters. Effectively, it defines how many characters are visible on each line.



A cols attribute on a textarea element.
The cols attribute dictates the width of the textarea.

<textarea rows="5" cols="60">
Unlike most Dutch masters of the 17th century,
Rembrandt's works depict a wide range of style
and subject matter, from portraits and self-portraits
to landscapes, genre scenes, allegorical and
historical scenes, and biblical and mythological
themes as well as animal studies.

Using cols

The cols attribute specifies the width of the textarea.

The width is specified as the number of cols (columns), i.e. characters, on each row.

If not set, the default value for a textarea is 20 characters.

Tip: The width and height of a textarea can also be specified by CSS.


<textarea cols="number">



Value Description
number A number, e.g. 55.

Browser support

Here is when cols support started for each browser:

1.0 Sep 2008
1.0 Sep 2002
1.0 Aug 1995
1.0 Jan 2006
1.0 Jan 2003

You may also like

 Back to <textarea>