HTML Tables
Organize data into rows and columns — like a spreadsheet built right into your webpage.
Tables: rows and columns for data
Tables were created to solve a specific problem: displaying data that has a natural grid structure — like a class schedule, sports scores, or a pricing comparison. Before tables, there was no way to align data in rows and columns on the web.
Every spreadsheet you have ever used (Google Sheets, Excel) is essentially a table. On the web, sites like ESPN use tables for standings, Amazon uses them for product comparisons, and Wikipedia is full of data tables.
A table is built from the outside in: <table> is the container, <tr> (table row) creates each horizontal row, and <td> (table data) creates each cell within a row. For header cells, use <th> instead of <td> — it bolds the text and tells screen readers "this cell labels the others."
<table> is the entire bookshelf. Each <tr> is a shelf (a row). Each <td> is a book sitting on that shelf (a cell). And <th> cells are the labels stuck on the shelf edge telling you what category of books goes there.Tables should only be used for tabular data — information that naturally belongs in a grid. In the early web (1990s–2000s), developers misused tables to create page layouts. This is now considered a serious anti-pattern because it breaks screen readers and makes responsive design nearly impossible. Use CSS Grid or Flexbox for layouts instead.
Start typing to see your tags visualized here...