Skip to content

When to Use Tables (and When Not To)

Knowing what a table can do is only half the skill. Knowing when to reach for it — and when to use something else — is just as important.

Tabular data has a meaningful relationship across both rows and columns. You need both axes to understand any single data point.

Ask yourself: “Does this cell only make sense when you know both its column header and its row header?”

If yes, it is tabular data. A table is the right choice.

Good candidates for a table:

Content typeExample
ScheduleClass times by day of the week
Pricing comparisonPlan features across price tiers
Data comparisonTrail ratings by distance and difficulty
StatisticsPlayer stats by game and category
Specification sheetProduct attributes and their values

In each case, understanding a single cell requires knowing both where it sits in the row and what column it falls under.

Page layout is the most common misuse. Developers once used <table> to arrange multi-column layouts because it was the only reliable way to do so before CSS matured. That technique is now obsolete.

Do not use <table> for:

  • Multi-column page layouts
  • Side-by-side image grids
  • Navigation menus
  • Card or tile arrangements
  • Any visual positioning that has nothing to do with data relationships

These should all be handled with semantic HTML elements and CSS. The table elements exist to represent data, not to control how things look on screen.

Accessibility: Screen readers announce table structure. A <table> with four cells used for layout will be announced as “table with 2 rows, 2 columns” — which is meaningless and confusing to a user who is trying to navigate content.

Maintainability: Layout built inside table cells is rigid. Changing it requires touching deeply nested HTML. CSS-based layout can be changed in one place.

Responsiveness: Tables do not shrink gracefully on small screens. A properly structured layout using CSS adapts to any screen size without extra work.

If the content requires rows and columns to make sense, use a table. If you could represent the same content without rows and columns, do not use a table.

Ask yourselfIf yesIf no
Does this data have column labels?Leaning toward tableProbably not a table
Does this data have row labels?Leaning toward tableProbably not a table
Would removing a row or column destroy meaning?TableNot a table
Am I doing this to control layout?Not a tableProceed

Open index.html in VS Code — but do not make any changes yet.

Look at the table you built in the previous lessons. Then look at the rest of your page content: the sections, lists, and description list.

For each of the following content types, decide: table or not a table?

  1. A list of gear items you pack for a hike
  2. A comparison of three trail difficulty ratings (Easy, Moderate, Strenuous) showing distance and elevation for each
  3. A navigation menu linking to pages on your site
  4. A weekly hiking schedule showing the trail name and time for each day of the week
  5. A glossary of trail terms and their definitions

Think through each one before checking your reasoning:

  1. List of gear — No column relationship. Use <ul>.
  2. Difficulty comparison — Rows (ratings) × Columns (distance, elevation). Table.
  3. Navigation menu — This is structural, not data. Use <nav> + <ul>.
  4. Weekly schedule — Rows (days) × Columns (trail, time). Table.
  5. Glossary — Term–definition pairs. Use <dl>.

If your existing table fits one of these “table” scenarios, it is correctly placed. If it does not, consider whether a list or description list would be a better fit — and make the change.

  • Tabular data has a meaningful relationship across both rows and columns.
  • Good use cases: schedules, pricing charts, comparisons, statistics, spec sheets.
  • Never use <table> for layout — it harms accessibility, maintainability, and responsiveness.
  • The test: does a cell only make sense when you know both its row and its column? If yes, use a table.