The HTML5 colgroup Tag

The HTML5 <colgroup> tag is necessary when it comes to specifying the set of one or more columns. The column/s should appear in a table that has to be formatted. The use of HTML5 <colgroup> tag is extensive because it avoids the need to format cells and columns one by one. It is essential in applying the same formatting and aesthetics for a particular set of columns.

There are certain limitations when the HTML5 <colgroup> tag is used. It is supposedly utilized along with a <table> element. It is placed after the <caption> element. If the <thread>, <tbody>, <tfoot> and <tr> elements are used, the HTML5 <colgroup> tag is placed before these.

If in case the column that will be formatted is a part of a <colgroup>, the <col> tag is utilized to specify the format of the column. The <col> tag is placed inside the <colgroup> tag.

The HTML5 <colgroup> tag is in perfect harmony with the Event Attributes and Global Attributes in HTML5. However, some of the attributes in HTML4.01 are no longer being used in HTML5. The attributes for the HTML5 <colgroup> tag are the following:

Attribute

Value

Description

align

left
right
center
justify
char

HTML5 does not support it.

char

character

HTML5 does not support it.

charoff

number

HTML5 does not support it.

span

number

Defines the number of columns the <colgroup> should span

valign

top
middle
bottom
baseline

HTML5 does not support it.

width

%
pixels
relative_length

HTML5 does not support it.

 

Featured pages

Overview

Learn about HTML5 architecture, design principles and patterns on HTML5 Overview Tutorial. Become …

Tags

Learn about HTML5 tags and discover a new list of HTML5 tags. Find out about HTML5 tags support by…

Welcome

 Learn HTML5 development techniques, tips and tricks on our website. Find out what is required…

Date Time Picker

HTML5 forms use date and time controls regularly. HTML5 date and time controls are used by booking …