w3resource logo


HTML rows attribute - HTML tutorials

HTML rows attribute

rating Average rating 10 out of 10. Total 1 users rated.

<<PreviousNext>>

Description

Purpose of the HTML rows attribute is to define number of rows in a textarea element and list of lengths (of rows) in a frameset.

Supported elements

HTML rows attribute supports textarea and frameset elements.

Syntax

<ElementName rows="value" >.....</ElementName>

Where ElementName is any supported element.

Type of value

Number for textarea. Percentage or relative length for frameset.

Value

For text area a number indicating number of rows.

For frameset a list of, number followed by % or * (indicating relative length) for specifying length of frames.

Default value

Default value of HTML rows attribute for frameset is 100% which indicates one row.

Supported doctypes

HTML 4.01 strict, HTML 4.01 transitional, HTML 4.01 frameset for textarea.

HTML 4.01 frameset for frameset.

Example of HTML rows attribute with textarea element

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Example of HTML rows attribute with  textarea element</title>
</head>
<body>
<form name="user_info" action="action.php" method="post"> 
Name : <input type="text" name="name"><br>
email  : <input type="text" name="email"><br>
Describe yourself : <br> 
<textarea rows="10" cols="10" name="describe_yourself">
</textarea><br>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>

Result

html rows attribute with textarea element

View this example in a separate browser window

Example of HTML rows attribute with textarea element

Example of HTML rows attribute with frameset element

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Example of HTML rows attribute with frameset element</title>
</head>
<frameset rows="20%,*,20%" > 
<frame src="../../html/attributes/header.html" frameborder="1" name="header" title="Header window"> 
<frame src="../../html/attributes/content.html" frameborder="0" name="content" title="Content window">
<frame src="../../html/attributes/footer.html" frameborder="0" name="footer" title="footer window">
</frameset>
</html>

Result

html rows attribute with frameset element

View this example in a separate browser window

Example of HTML rows attribute with frameset element



<<PreviousNext>>