Columns and Rows

In a textarea, one can specify the number of columns and rows, but using the following attributes cols and rows. These attributes change the size of the displayed element, as well as how text looks when typed.

  • cols is the width of the textarea in character widths (i.e. this is the number of characters that will fit from left to right).
  • rows is the number of visible lines.
HTML
<p>
  Comments or Concerns:
  <textarea name="comments" id="test-textarea" cols="20" rows="4">Enter up to 500 characters...</textarea>
</p>

Please Enter:

Birth Year:

Net ID:

Password:

Comments or Concerns:

NOTE: These attributes can also be overridden in CSS.