Column Group tag represents a group of one or more columns within a table in an HTML document. The main purpose of this tag is to specify the properties for a group of columns. A single HTML table can include multiple
tags
.
The
element is a child element of the
tag and the parent of the
tag. This tag is useful for applying styles to entire columns , instead of repeating the styles for each column, and for each row.
tag supports the global attributes and the event attributes.
th, td{ padding: 20px; }
Attribute
Value
Description
align
The align attribute will help to set the alignment of the content of the column. Not supported in HTML5.
left
It aligns to the left.
right
Used to the right alignment.
center
Helps to align the center.
justify
This value helps to stretch the lines so that each line has equal width.
char
It is used to align a special character with a minimum offset , which is defined by the “char” and “charoff” attributes.
char
character
This value will align the content related to an
element to a character. It is used only if the attribute is aligned = “char”.** Not supported in HTML5.**
charoff
number
Helps to shift the content of the cell relative to the character specified as the value of the attribute to the right (positive values) or to the left (negative values). It is used only if the attribute is aligned = “char”.** Not supported in HTML5.**
span
number
Sets the quantity of columns , the properties of which are determined by the
element. The number must be a positive integer. If the parameter is not specified, the default value is 1.
valign
The “valign” attribute helps to align the content vertically.
top
It helps to align at the top of the line.
bottom
This value used to align the bottom edge.
middle
Used for center or middle alignment.
baseline
This value is used for baseline alignment. Not supported in HTML5.
width
% pixels relative_length
It will set the width of the column. Not supported in HTML5.
Top comments (0)