The <col> element defines one or more columns inside a <colgroup>. Use it to apply column-level styles (such as background or width) without repeating rules on every cell.
It is valid only as a child of <colgroup> that has nospan attribute. <col> is a void element (start tag only). Prefer CSS over the old presentational attributes.
Baseline · Widely available.
Not deprecated as an element. Stable across browsers since about July 2015 (and earlier in practice). Some CSS effects on columns have limits.
Deprecated attributes.
Do not use align, bgcolor, char, charoff, valign, or width on <col>. Use CSS instead.
Syntax
HTML Syntax
syntax.html
<colgroup><col span="n"></colgroup>
No end tag and no content. Put one or more <col> elements inside <colgroup> (without span on that colgroup).
Reference
Attributes
Modern and legacy attributes you may see on <col>:
First column is the period label (<col> with default span 1).
span="5" styles Monday–Friday together.
span="2" styles Saturday–Sunday together.
1 + 5 + 2 = 8, matching eight cells in each row.
Edge Cases & Pitfalls
Most col bugs are wrong parents, painted-over backgrounds, or deprecated attributes.
parent
Only inside colgroup without span
Do not put <col> directly under <table>. If colgroup has span, it cannot contain col children.
css
Limited CSS on col
Reliable effects include background, width, visibility: collapse, and borders when border-collapse: collapse. text-align on col does nothing useful.
layers
Cell backgrounds hide column color
Column backgrounds sit under row and cell backgrounds. Opaque th/td fills will cover the column color.
count
Spans must match columns
The total of all colspan values should equal the number of columns in the table body.
deprecated
Skip presentational attributes
width, align, valign, bgcolor, char, and charoff are obsolete — migrate to CSS.
Compatibility
Browser Support
The <col> element is core HTML for tables in every modern browser. Column CSS support is solid for background and width; some older presentational attributes vary.
✓ Baseline · Widely available
<col>
Widely available since about July 2015. Chrome, Firefox, Safari, Edge, and Opera support col inside colgroup. Prefer CSS over deprecated HTML presentational attributes.
98%Global support (approx.)
Google ChromeAll
Full support
Mozilla FirefoxAll
Full support
Apple SafariAll
Full support
Microsoft EdgeAll
Full support
OperaAll
Full support
Samsung InternetAll
Full support
Internet ExplorerAll
Supported
<col>Widely supported
Bottom line: Safe to use for column styling inside colgroup. Stick to CSS for color and width; ignore deprecated presentational attributes.
Remember
Key Takeaways
Role:<col> targets columns inside <colgroup> for styling.
span: one element can cover several consecutive columns.
CSS: backgrounds and width work best; align cells with selectors, not col inheritance.
Legacy: drop width, align, bgcolor, and friends.
One line: put void <col> tags in a span-free <colgroup>, then style columns with CSS.
UA style
Default CSS Settings
col does not render its own box like a cell. Typical mapping:
default.css
col {
display: table-column;
}
Visible look comes from limited CSS you apply (background, width, and so on) and from the cells in that column.
Frequently Asked Questions
The col element defines one or more columns inside a colgroup so you can style those columns (for example background or width) without repeating styles on every cell.
Only as a child of colgroup, and that colgroup must not have a span attribute. Place colgroup near the start of the table (after caption if present).
span is a positive integer that says how many consecutive columns this col covers. The default is 1.
col has no descendants, so properties that rely on inheritance (like text-align or vertical-align set on col) do not style the cells. Style td/th with nth-of-type selectors instead.
No. Those attributes are deprecated. Use CSS width, background-color, and cell text-align / vertical-align instead.
Yes. It has a start tag only — no end tag and no content inside.