Skip to content
Related Articles

Related Articles

Improve Article

HTML | <colgroup> width Attribute

  • Last Updated : 07 Aug, 2019
Geek Week

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.


<!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

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

My Personal Notes arrow_drop_up
Recommended Articles
Page :