HTML Table Reference

A reference for table tags and table attributes. Visit HTML table basics Overview on MDN for more information.

HTML table tags

Tag Name Description
<table> Table The container element for all HTML tables.
<thead> Table Head Groups the header content in a table.
<tbody> Table Body Groups the body content in a table, used after <thead> and before <tfoot> if used.
<tfoot> Table Footer Groups the footer content in a table, used after <tbody> or <thead> if <tbody> is not used.
<tr> Table Row Defines a row in a table, containing one or more <td> or <th> elements.
<td> Table Data Defines a cell in a table that contains data.
<th> Table Header Represents a header cell in a table that can be used at the start of a row or column. It comes with default styling (bold and centred text). Typically used within the <thead> element.

HTML Table attributes

Attribute Name Description
colspan Column Span How many columns the table cell spans.
rowspan Row span How many rows a table cell spans.

Tables and Accessibility

If you use the semantic table elements above correctly, you are already making good progress towards a well-structured table. However, there are a few additional things you can add to your tables to increase accessibility for all users.

For more information, visit the MDN guide for HTML table advanced features and accessibility.