C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
HTML <colgroup> tagHTML <colgroup> tag specifies group of column within an HTML table. It is used a parent container of one or more <col> elements to apply different properties in an HTML table. NOTE: The <colgroup> tag must be used with <table> element after the <caption> and before <thead> or <tbody> elements.Syntax<colgroup>......</colgroup> Following are some specifications about the HTML <colgroup> tag
Example<!DOCTYPE html> <html> <head> <title>Colgroup tag</title> </head> <body> <h2>Example of Colgroup Tag</h2> <table border="1"> <colgroup> <col style="background-color: green" width="40"> <col span="2" style="background-color: #ff7256" width="80"> </colgroup> <tr> <th>Sr.No</th> <th>Product</th> <th>Price</th> </tr> <tr> <td>1</td> <td>Rice</td> <td>85</td> </tr> <tr> <td>2</td> <td>Butter</td> <td>260</td> </tr> <tr> <td>3</td> <td>Mango</td> <td>125</td> </tr> </table> </body> </html> Output: Attributes
Global AttributeHTML <colgroup> tag supports all Global attributes in HTML. Event AttributeHTML <colgroup> tag supports all event attributes in HTML. Supporting Browsers
Next TopicHTML data Tag
|