The <table> element represents tabular data — information in a two-dimensional grid of rows and columns. Each row is a <tr>; cells are <th> (headers) or <td> (data).
Not deprecated. Core table support has been stable across browsers since about July 2015 (and much earlier in practice).
Deprecated attributes.
Do not use align, bgcolor, border, cellpadding, cellspacing, frame, rules, summary, or width on <table>. Prefer CSS and a <caption> instead.
Non-standard.
Some browsers historically accepted a non-standard height on <table>. Use CSS min-height (or height) instead.
Syntax
HTML Syntax
syntax.html
<table>rows & cells</table>
Both start and end tags are required. Put an optional <caption> first, then optional column groups, then header/body/footer row groups (or plain <tr> rows).
Reference
Attributes
Modern <table> has no current element-specific attributes — only global attributes. These older attributes are deprecated (shown for migration):
Count columns from the header row (here: Day, Open, Close = 3).
Set colspan="2" so one cell covers Open and Close.
Keep the math right: Day (1) + spanned cell (2) = 3 columns.
Use sparingly. Heavy spanning is harder for screen readers; split into smaller tables when possible.
Edge Cases & Pitfalls
Most table problems come from layout misuse, missing headers, or over-complex spans.
layout
Do not use tables for page layout
Tables describe data relationships. Page structure belongs to CSS Grid or Flexbox.
a11y
Always mark real headers
Bold text in a <td> is not a header. Use <th> (and scope when helpful).
attrs
Skip obsolete presentational attributes
border, cellpadding, and friends are deprecated. Use CSS such as border-collapse.
complexity
Prefer several simple tables
Heavy colspan/rowspan grids are hard to navigate. Split data or use headers/id only when you must keep one complex table.
mobile
Wide tables need overflow plans
Wrap the table in a scrollable container or redesign for small screens so content stays readable.
Compatibility
Browser Support
The <table> element is core HTML in every browser. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
<table>
Widely available since about July 2015 (and long before as HTML tables). Chrome, Firefox, Safari, Edge, and Opera all support tabular markup fully. Presentational attributes are obsolete; use CSS instead.
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
<table>Widely supported
Bottom line: Safe to use everywhere for tabular data. Style with CSS, provide captions and headers, and avoid layout tables.
Remember
Key Takeaways
Role:<table> is for tabular data — not page layout.
Structure: rows with tr; labels with th; values with td.
Clarity: add caption, and use thead/tbody/tfoot when sections help.
Style: CSS only — skip deprecated presentational attributes.
One line: put real data in a <table> with <th> headers (and a caption when it needs a name).
UA style
Default CSS Settings
Typical user-agent styling for tables (simplified). Exact rules vary by browser:
The table element presents tabular data in rows and columns. Use it for information that belongs in a grid (schedules, comparisons, records) — not for page layout.
th is a header cell for a column or row label. td is a normal data cell. Screen readers treat th as a heading for related cells.
Not for every table. A simple table can use only table, tr, th, and td. Use thead, tbody, and tfoot when you want a clear header, body, and footer (for example totals).
No. Those attributes are deprecated. Style tables with CSS — for example border-collapse, border, padding, and border-spacing.
Add a caption that names the table, use th for headers, and set scope="col" or scope="row" when it helps. Prefer simple tables over heavy colspan and rowspan.
No. Tables are for tabular data only. Use CSS Grid or Flexbox to arrange page sections.