HTML DOM rows attribute

Definition and Usage

The rows attribute can be used to set or return the number and size of rows in the frame.

A list of pixels or percentages separated by commas defines the number of columns and their heights:

Syntax

framesetObject.rows=row1,row2,row3....

Example

In our example, the first step is to create an HTML document containing a frameset with two columns. Each column is set to 50% of the browser window:

<html>
<frameset rows="50%,50%">
  <frame src="frame_rows.htm">
  <frame src="frame_a.htm">
</frameset>
</html>

The HTML document "frame_rows.htm" is placed in the first column, and the HTML document "frame_a.htm" is placed in the second column.

The following is the source code of "frame_rows.htm":

<html>
<head>
<script type="text/javascript">
function changeRows()
  {
  parent.document.getElementById("main").rows="30%,70%"
  }
function restoreRows()
  {
  parent.document.getElementById("main").rows="50%,50%"
  }
</script>
</head>
<body>
<form>
<input type="button" onclick="changeRows()" />
value="Change row size" />
<input type="button" onclick="restoreRows()" />
value="Restore row size" />
</form>
</body>
</html>

Try It Yourself (TIY)

Change the Frame Set Row Size