Column width specifier

col

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

Normally the colgroup element should have one col element for each implicitly defined column. Nevertheless, fewer col elements may be defined when their 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 { width: 400px; }
}
Defining the width of the first column only
0

semantax > row-column > colColumn width specifier

🔗 🔎