HTML <textarea> rows Attribute

The rows attribute on a <textarea> tag specifies the number of lines of text, i.e. rows, that are visible in the textarea.



A rows attribute on a <textarea> element.
The rows dictates the textarea height. A scrollbar appears because the content is larger than the number of rows allowed.

<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 rows

The rows attribute specifies the height of the textarea, as expressed in number of lines.

If the content exceeds the number of lines, i.e. rows, a vertical scrollbar will appear.

The default value for rows is 2.

Tip: A textarea's height and width can also be specified with CSS height and width properties.


<textarea rows="number">



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

Browser support

Here is when rows 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>