html tutorial - cols Attribute in HTML - html5 - html code - html form




Cols attribute in html

Learn html - html tutorial - Cols attribute in html - html examples - html programs

  • The cols attribute defines the visible width of a text area.
  • The cols attribute specifies a column within a textarea.

Syntax for cols attribute in HTML:

<textarea cols = “number”>content </textarea>

Applies To:

Elements Attribute
<textarea> cols

Attribute Values:

Value Description
number Specifies the width of the text area. Default value is 20.

Sample Coding for cols Attribute in HTML:

Tryit<!DOCTYPE html>
<html>
<body>
        <head>
        <title>Wikitechy HTML cols attribute</title>
        </head>
        <textarea rows="5" cols="80">
         Wikitechy is an enhanced tutorials zone providing the best learning curve. 
        Sample code is provided for each and every topic to improve the user's knowledge.
        </textarea>
 </body>
 </html>

Code Explanation for cols Attribute in HTML:

 cols Attribute Code Explanation

  1. <textarea> tag used to define a multi-line text input control.
  2. row attribute is used to set the number of lines as “5” in a text area.
  3. cols attribute is used to set the width as “80” for the textarea.

Output fo cols Attribute in HTML:

 cols Attribute Tag Output

  1. In this output, the content Wikitechy is an enhanced tutorials... had been displayed with a specified width in a text area.

Browser Support for cols Attribute in HTML:

Yes Yes Yes Yes Yes

Tips and Notes

  • The textarea size can also be determined by the CSS height and width properties.

Related Searches to cols Attribute in html

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need money to operate the site, and almost all of it comes from our online advertising.

Please add wikitechy.com to your ad blocking whitelist or disable your adblocking software.

×