- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 −
|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.|
|Defines vertical alignment, not supported in Html5.|
pixels or %
|Specifies a default width for each column spanned by the current col element, not supported in Html5 .|
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>
- 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?
- Include list groups within any Bootstrap Panel
- How to include Modernizr in HTML document?
- How to include an acronym in HTML?
- How to include an abbreviation in HTML?
- How to include CSS in HTML Pages
- How to include the character encoding in HTML?
- How to include an embedded object 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 keyboard text in HTML