FRENVersion française

Conversion & pricing

Comparison table

Tableau comparatif

Demo

Loading demo…

The table under the cards of a pricing page: one column per plan, one row per feature, grouped by category. It answers the question "what do I get if I move up a plan?". Not to be confused with the pricing table, which is the row of cards above it.

Story

Did you know

The format comes from consumer magazines like Which? in the UK or Que Choisir in France: models in columns, criteria in rows. The pricing page reuses the same grid, with one difference: the seller fills it in, and picks the column to highlight.

Timeline

  1. paperCatalogues and consumer magazines compare products in tick-box tables.
  2. 1997HTML 3.2 standardises <table>. HTML 4.0, the same year, adds <thead>, <tbody> and the scope attribute.
  3. late 2010sposition: sticky becomes widely available: the sticky table header no longer needs JS.

Vocabulary

Names

FR
Tableau comparatif, comparatif des offres, matrice de fonctionnalités, tableau des fonctionnalités
EN
Comparison table, feature comparison table, feature matrix, plan comparison, tier feature table

Common uses

  • SaaS pricing pages, below the plan cards
  • Mobile plans, broadband bundles, streaming subscriptions
  • Comparing 2 to 4 products side by side in e-commerce
  • "Us vs. the competition" pages

Often paired with

The components it usually sits with, by page type, in reading order.

Code

<table id="plans">
  <caption>Compare plans</caption>
  <thead>
    <tr>
      <td></td>
      <th scope="col">Free <span>$0</span></th>
      <th scope="col">Pro <span>$12</span></th>
      <th scope="col">Team <span>$24</span></th>
    </tr>
  </thead>
</table>

<script>
  const groups = [
    { name: 'Essentials', rows: [{ feature: 'Storage', values: ['1 GB', '10 GB', '100 GB'] }] },
    { name: 'Collaboration', rows: [{ feature: 'SSO', values: [false, false, true] }] },
  ]
  // Booleans: visible icon hidden from screen readers, text for screen readers
  const cell = (v) => typeof v === 'string' ? v
    : `<span aria-hidden="true">${v ? '✓' : '—'}</span><span class="sr-only">${v ? 'Included' : 'Not included'}</span>`
  const table = document.getElementById('plans')
  for (const g of groups) {
    const tbody = table.createTBody()
    tbody.innerHTML = `<tr><th scope="rowgroup" colspan="4">${g.name}</th></tr>`
      + g.rows.map((r) => `<tr><th scope="row">${r.feature}</th>${r.values.map((v) => `<td>${cell(v)}</td>`).join('')}</tr>`).join('')
  }
</script>

<style>
  /* Sticky on the cells, not on thead */
  thead th { position: sticky; top: 0; background: Canvas; }
</style>

Good to know

  • A pricing page holds two different components: the pricing table (the cards) and the comparison table below. The "Compare all features" link under the cards is just an anchor to the table.
  • Put position: sticky; top: 0 on the thead th cells, not on <thead>: that form works everywhere. Give them an opaque background, or rows show through. An ancestor with overflow: hidden or auto becomes the scroll container and unpins the header from the page.
  • On mobile, 4 columns don't fit. Three options: horizontal scroll with a sticky first column (position: sticky; left: 0), one plan at a time with a plan picker or tabs, or one accordion per category.
  • Keep only the rows that tell plans apart. Forty rows of ✓ everywhere bury the information: group by category and leave the rest to a docs page.
  • Highlight the recommended column with a class on its cells. A background on <col> works too, but any cell with its own background hides it (which sticky cells need).
  • Write values in full, with the unit: "10 GB", "Unlimited", "90 days". Avoid ∞ and bare numbers.

Accessibility

Must have

  • A real <table> with a <caption>, not a grid of divs. Screen readers then announce the plan and the feature for every cell (WCAG 1.3.1).
  • scope="col" on each plan, scope="row" on each feature, and a <th scope="rowgroup" colspan> at the top of each category <tbody>.
  • No information carried by an icon or a colour alone (WCAG 1.4.1): ✓ with aria-hidden="true" plus visually hidden text "Included" / "Not included". An empty cell is read as blank.

Often forgotten

  • The sticky header must not cover the focused element (WCAG 2.4.11 Focus Not Obscured): add scroll-padding-top matching the header height on the scroll container.
  • The container that scrolls sideways on mobile must be reachable by keyboard: tabindex="0", role="region" and an aria-label (WCAG 2.1.1).
  • Feature explanations belong on a <button> ("?" icon) that opens a tooltip or popover, not on hovered text: that is out of reach for keyboard and touch users.

Nice to have

  • Flag the recommended column with a text badge ("Recommended"), not just a coloured background.
  • CTAs that name the plan they pick ("Try Pro"), rather than three identical "Get started" buttons (WCAG 2.4.6).

Who uses it