Skip to content
Related Articles

Related Articles

Save Article
Improve Article
Save Article
Like Article

HTML | <textarea> cols Attribute

  • Last Updated : 29 Apr, 2019

The HTML <textarea> cols Attribute is used to tell the browser how many average-width characters should fit on a single line i.e the number of columns to display.
It is used to specify the visible width of the <Textarea> Element.


Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

<textarea cols="number">

Attribute Values: It contains the value i.e number which specifies the width of the Textarea. It has a Default value which is 20.


<!-- HTML program to illustrate cols attribute -->
<!DOCTYPE html>
      HTML Textarea cols Attribute
        h2 {
            text-align: center;
<body style="text-align:center;">
    <h1 style="color: green;"
        HTML <textarea>cols Attribute 
    <!-- Below textarea is 
        assigned a cols value 25 
            That is, 25 characters
          will fit in a line -->
    <textarea rows="4" 
        A computer science portal for geeks.

Output :

Supported Browsers: The browser supported by HTML <Textarea> cols Attribute are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

My Personal Notes arrow_drop_up
Recommended Articles
Page :