QuickDevGuide

Home › HTML

Tables — HTML

Tables in HTML organize complex data into a grid of rows and columns. While they were used for page layouts in the 1990s, today they should only be used for tabular data (like spreadsheets, schedules, or pricing grids). Core Table Structure Tables are built row by row: <table> is the wrapper, <tr> (Table Row) defines a horizontal row, <th> (Table Header) defines a header cell (bold and centered by default), and <td> (Table Data) defines a standard content cell. Semantic Grouping For proper structure, use <thead> for header rows, <tbody> for data rows, and <tfoot> for footer/summary rows. The <caption> element provides a title for the table — important for both SEO and accessibility. Accessibility Use the scope attribute on <th> to specify whether it heads a column (scope="col") or a row…

Key Takeaways