
Rows contain table header ( ) and table data ( ) cells which, in turn, contain all the data. Each of these is made up of table rows ( ). Inside the, you'll find the table headers ( ), table bodies ( ), and, optionally, table footers ( ). If the rows of the grid can be expanded and collapsed, use role="treegrid" instead. If the table maintains a selection state, has two-dimensional navigation, or allows the user to rearrange cell order, set role="grid". The implicit ARIA role of a is table assistive technologies know this element is a table structure containing data arranged in rows and columns.

The tag wraps the table content, including all the table elements. While Learn HTML isn't fundamentally about CSS, and there is an entire course dedicated to learning CSS, we will cover some table-specific CSS properties. In this section, we are going to discuss all the elements that make up the table, along with some accessibility and usability features you should consider as you present tabular data. If you simply want to lay out non-tabular content neatly, such as a large group of thumbnail images, tables are not appropriate: instead, create a list of images and style the grid with CSS. If data is being presented, compared, sorted, calculated, or cross-referenced, then is probably the right choice. The decision to use a should be based on the content you are presenting and your users' needs in relation to that content. HTML tables are used for displaying tabular data with rows and columns.
