Skip to content
Related Articles
Open in App
Not now

Related Articles

HTML | <colgroup> width Attribute

Improve Article
Save Article
  • Difficulty Level : Expert
  • Last Updated : 31 Dec, 2021
Improve Article
Save Article

The HTML <colgroup> width Attribute is used to specify the width of the colgroup element. The <colgroup> attribute sets a predefined width of column group.


<colgroup width="pixels|%|relative_lngth">

Attribute Values:

  • pixels: It specify the width of the colgroup in terms of pixels.
  • %: It specify the width of the colgroup element in percent. For ex-width=”50%”
  • relative_length: It divides the length of the table in terms of pixels.

Note: The

width attribute is not supported by HTML 5.


<!DOCTYPE html> 
        HTML ColumnGroup width Attribute 
        #myColGroup { 
            background: green; 
        table { 
            color: white; 
            background: yellow; 
        #Geek_p { 
            color: green; 
            font-size: 30px; 
        td { 
            padding: 10px; 
        <h1 style="color:green;"
        <h2>HTML ColumnGroup width Attribute</h2
            <colgroup id="myColGroup" span="3"
                    align = "left" width="150"


Supported Browsers: The browsers supported by <colgroup> width attribute are listed below:

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

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!