CSS HTML Validator - The fast, all-in-one, HTML, CSS, Link, SEO, spelling, and accessibility checker for Windows, & htmlval for Mac and Linux
Home Help: <table> element

The <table> Element

Table Content

Use the <table> element for data with two dimensions.

Attributes for <table>
TypeAttribute List
'Standard' Attributes(none)
New HTML5 Attributes"popover"
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)

Help us improve this page: Suggest a link or noteReport a problem