Columns and Rows

You can specify the number of cols and rows through the appropriate attributes. This changes the size of the displayed element, as well as how text will look 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: Typically, and as is the case with many size parameters that you can set in HTML, you should override these parameters with CSS.