Table Content
Use the <table> element for data with two dimensions.
Attributes for <table>
Type | Attribute List |
'Standard' Attributes | (none) |
New HTML5 Attributes | "writingsuggestions" |
Obsolete Attributes | "align", "background", "bgcolor", "border", "bordercolor", "cellpadding", "cellspacing", "frame", "height", "rules", "summary", and "width" |
Syntax Notes for <table>
- For layout tables, the "summary" attribute should not be used or should be empty (summary=""). NOTE: When possible, use CSS instead of tables for layout. In HTML5, tables must not be used for layout.
Recommended Links
Accessibility Information & Tips
- Although still allowed (not prohibited) by WCAG 2.0, layout tables should be avoided whenever possible in favor of CSS layouts in order to maintain the semantic meaning of table elements and the separation of presentation from content. Visit https://www.w3.org/TR/WCAG20-TECHS/H39 for more information.
- Use the <caption> element with data (non-layout) tables to identify the table. Use the "summary" attribute for the <table> element to provide an overview of the purpose of the table or to explain how to navigate the table. The caption and summary text should not duplicate each other. Visit https://www.w3.org/TR/WCAG20-TECHS/H39 for more information.
- Use the <table> element and other table elements (<tr>, <th>, <td>, etc.) to present tabular information. This preserves data relationships even when users cannot see the table or the presentation format is changed. Do not use tabs or spacing to create visual presentations of columns. Visit https://www.w3.org/TR/WCAG20-TECHS/H51 for more information.
Search Engine Optimization (SEO)
- Following accessibility standards may improve search engine rankings. Use "alt", "title", and table "summary" attributes whenever relevant and possible. Use keywords and search terms in them but keep them accurate. Using CSS HTML Validator's optional accessibility checking can help.
Search Engine Links (for more information)