coderef

Table stylingLimited availability

Attributes and properties of table elements, such as align, vAlign, noWrap, bgcolor, or char set various visual presentation properties of the table and its sections and cells.

Not yet supported in all major browsers — check the table and provide a fallback.

Discouraged: Some table styling attributes have no effect. They are superseded by CSS.

Browser support

DesktopChrome
✕Not supportedup to 155
Current: 155
Edge
✕Not supportedup to 154
Current: 154
Firefox
✕Not supportedup to 157
Current: 157
Safari
✕Not supportedup to 27
Current: 27
MobileChrome Android
✕Not supportedup to 155
Current: 155
Firefox Android
✕Not supportedup to 157
Current: 157
Safari iOS
✕Not supportedup to 27
Current: 27

How to use

Not supported in Chrome, Edge, Firefox, Safari, Chrome Android, Firefox Android, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.

Example

Full syntax and examples are on MDN: align.

Feature detection

JS · check before using
if ("align" in document.createElement("table")) {
  // the align attribute/property of <table> is supported
}

Sub-features

Support for each part of the feature (89). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
HTMLTableCaptionElement.align112131841
HTMLTableCellElement.align112131841
HTMLTableCellElement.axis112131841
HTMLTableCellElement.bgColor112131841
HTMLTableCellElement.ch112131841
HTMLTableCellElement.chOff112131841
HTMLTableCellElement.height112131841
HTMLTableCellElement.noWrap112131841
HTMLTableCellElement.vAlign112131841
HTMLTableCellElement.width112131841
HTMLTableColElement.align112131841
HTMLTableColElement.ch112131841
HTMLTableColElement.chOff112131841
HTMLTableColElement.vAlign112131841
HTMLTableColElement.width112131841
HTMLTableElement.align112131841
HTMLTableElement.bgColor112131841
HTMLTableElement.border112131841
HTMLTableElement.cellPadding112131841
HTMLTableElement.cellSpacing112131841
Show 69 more
Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
HTMLTableElement.frame112131841
HTMLTableElement.rules112131841
HTMLTableElement.summary112131841
HTMLTableElement.width112131841
HTMLTableRowElement.align112131841
HTMLTableRowElement.bgColor112131841
HTMLTableRowElement.ch112131841
HTMLTableRowElement.chOff112131841
HTMLTableRowElement.vAlign112131841
HTMLTableSectionElement.align112131841
HTMLTableSectionElement.ch112131841
HTMLTableSectionElement.chOff112131841
HTMLTableSectionElement.vAlign112131841
caption.align1121≤4184≤3.2
col.align1121≤4184≤3.2
col.char✕✕✕✕✕✕✕
col.charoff✕✕✕✕✕✕✕
col.valign1121≤4184≤3.2
col.width1121≤4184≤3.2
colgroup.align1121≤4184≤3.2
colgroup.char✕✕✕✕✕✕✕
colgroup.charoff✕✕✕✕✕✕✕
colgroup.valign1121≤4184≤3.2
colgroup.width1121≤4184≤3.2
table.align112111841
table.bgcolor112111841
table.border112111841
table.cellpadding112111841
table.cellspacing112111841
table.frame112111841
table.rules112111841
table.summary112111841
table.width112111841
tbody.align112131842
tbody.bgcolor112111841
tbody.char✕✕✕✕✕✕✕
tbody.charoff✕✕1✕✕4✕
tbody.valign112131842
td.abbr112111841
td.align112131842
td.axis112111841
td.bgcolor112111841
td.char✕✕✕✕✕✕✕
td.charoff✕✕1✕✕4✕
td.scope112111841
td.valign112131842
td.width112111841
tfoot.align112131842
tfoot.bgcolor112111841
tfoot.char✕✕✕✕✕✕✕
tfoot.charoff✕✕1✕✕4✕
tfoot.valign112131842
th.align112131842
th.axis112111841
th.bgcolor112111841
th.char✕✕✕✕✕✕✕
th.charoff✕✕1✕✕4✕
th.valign112131842
th.width112111841
thead.align112131842
thead.bgcolor112111841
thead.char✕✕✕✕✕✕✕
thead.charoff✕✕1✕✕4✕
thead.valign112131842
tr.align112131842
tr.bgcolor112111841
tr.char✕✕✕✕✕✕✕
tr.charoff✕✕✕✕✕✕✕
tr.valign112131842