
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
How to include groups of table columns in HTML?
Use the <colgroup> tag to include groups of table columns.The HTML <colgroup> tag is used for specifying properties for a group of columns within a table. If you need to apply different properties to a column within a colgroup, you can use the HTML col tag within the colgroup tag.
The following are the attributes −
Attribute | Value | Description |
---|---|---|
Align | right left center justify char | Defines horizontal alignment, not supported in Html5. |
Char | character | Defines a character to use to align text on (use with align ="char"), not supported in Html5. |
Charoff | pixel | Defines the number of columns the <col> should span, not supported in Html5 |
Span | number | Defines the number of columns the <col> should span, not supported in Html5. |
Valign | bottom middle top baseline | Defines vertical alignment, not supported in Html5. |
Width | pixels or % | Specifies a default width for each column spanned by the current col element, not supported in Html5 . |
Example
You can try to run the following code to implement <colgroup> tag in HTML −
<!DOCTYPE html> <html> <head> <title>HTML col Tag</title> </head> <body> <p>This example shows a colgroup that has three columns of different widths:</p> <table border = "1"> <colgroup span = "4"> <col width = "40"></col> <col width = "70"></col> <col width = "100"></col> <col width = "130"></col> <col width = "160"></col> </colgroup> <tr> <td>One</td> <td>Two</td> <td>Three</td> <td>Four</td> <td>Five</td> </tr> </table> </body> </html>
- Related Articles
- How do we include attributes for table columns in HTML?
- How to merge table columns in HTML?
- How do we include a table caption in HTML?
- How to create table rows & columns in HTML?
- How to include an acronym in HTML?
- How to include an abbreviation in HTML?
- How to include Modernizr in HTML document?
- How to include JavaScript in HTML Documents?
- How to include CSS in HTML Pages
- How to include another HTML file in an HTML file?
- How to include the character encoding in HTML?
- How to include an input field in HTML?
- How to specify the number of columns a table cell should span in HTML?
- Include list groups within any Bootstrap Panel
- How to include the audio/video controls in HTML?

Advertisements