Column width specifier

colgroup

One or more col elements are placed within a "colgroup" element in order to define the styling and widths of the table's columns.

Normally the colgroup element should have one col element for each implicitly defined column. Nvertheless, fewer col elements may be defined when styling and widths are to be left up to the browser.

Properties

span
The number of columns that this col element spans.

Examples

table {
colgroup {
col.gray
col.blue
}
tr {
td AR
td Argentina
}
tr {
td BE
td Belgium
}
tr {
td CA
td Canada
}
}
style {
.gray { background-color: #777; }
.blue { background-color: #77F; }
}
One col for each table column

table {
colgroup {
col.w400
}
th {
th Country
th ISO-3166 alpha-2
th ISO-3166 alpha-3
th UN code
}
tr {
th Argentina
td AR
td ARG
td 032
}
tr {
th Belgium
td BE
td BEL
td 056
}
tr {
th Canada
td CA
td CAN
td 124
}
}
style {
.w400 { min-width: 400px; }
}
Defining the width of the first column only

semantax > row-column > colgroupColumn width specifier

🔎