CSS Portal

HTML rows Attribute

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
rows
HTML AttributeThis attribute is supported by all modern browsers.
Updated 29th March 2024

Description

The rows attribute in HTML is primarily used in the context of a <textarea> element. This attribute specifies the visible height of a text area, determining the number of lines that will be visible to the user without needing to scroll. It accepts a numerical value that represents the number of text lines. By adjusting the rows attribute, developers can control the text area's vertical size, making it more suitable for its intended use, whether for a short comment box or a larger text editing area. For instance, setting rows="4" makes the text area four lines tall. It's important to note that while the rows attribute helps define the initial size of the text area, users can typically resize it in their browser unless the resizing feature is explicitly disabled with CSS.

Syntax

<textarea rows="number">

Values

  • numberA number that specifies the rows of a textarea.

Applies To

Example

<textarea rows="10" cols="50">This is a text area with 10 rows and 50 columns.</textarea>
Open in editor

Browser Support

The following information will show you the current browser support for the HTML rows attribute. Hover over a browser icon to see the version that first introduced support for this HTML attribute.

This attribute is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee