webdevpuneet.com

Insurance Coverage Comparison Table — Free HTML CSS JS Snippet

Insurance Coverage Comparison Table · Tables · Plain HTML, CSS & JS · Live preview

CategoryTables

Copy & paste

Source Code

<div class="cc-wrap">
  <div class="cc-head">
    <h2>Compare plans</h2>
    <p>Every plan includes 24/7 claims support and no hidden fees.</p>
  </div>

  <div class="cc-table-scroll">
    <table class="cc-table">
      <thead>
        <tr>
          <th class="cc-row-label"></th>
          <th>Basic</th>
          <th class="cc-recommended">
            <span class="cc-badge">Most popular</span>
            Standard
          </th>
          <th>Premium</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td class="cc-row-label">Monthly premium</td>
          <td class="cc-price">$24<span>/mo</span></td>
          <td class="cc-recommended cc-price">$41<span>/mo</span></td>
          <td class="cc-price">$68<span>/mo</span></td>
        </tr>
        <tr>
          <td class="cc-row-label">Coverage limit</td>
          <td>$25,000</td>
          <td class="cc-recommended">$100,000</td>
          <td>$500,000</td>
        </tr>
        <tr>
          <td class="cc-row-label">Deductible</td>
          <td>$1,000</td>
          <td class="cc-recommended">$500</td>
          <td>$250</td>
        </tr>
        <tr>
          <td class="cc-row-label">Roadside assistance</td>
          <td class="cc-dash">—</td>
          <td class="cc-recommended cc-check">✓</td>
          <td class="cc-check">✓</td>
        </tr>
        <tr>
          <td class="cc-row-label">Rental car reimbursement</td>
          <td class="cc-dash">—</td>
          <td class="cc-recommended cc-check">✓</td>
          <td class="cc-check">✓</td>
        </tr>
        <tr>
          <td class="cc-row-label">Accident forgiveness</td>
          <td class="cc-dash">—</td>
          <td class="cc-recommended cc-dash">—</td>
          <td class="cc-check">✓</td>
        </tr>
        <tr>
          <td class="cc-row-label">New car replacement</td>
          <td class="cc-dash">—</td>
          <td class="cc-recommended cc-dash">—</td>
          <td class="cc-check">✓</td>
        </tr>
        <tr>
          <td class="cc-row-label">Claims response time</td>
          <td>5–7 days</td>
          <td class="cc-recommended">2–4 days</td>
          <td>24 hours</td>
        </tr>
      </tbody>
      <tfoot>
        <tr>
          <td class="cc-row-label"></td>
          <td><button class="cc-btn cc-btn-outline" onclick="selectPlan('Basic', this)">Choose Basic</button></td>
          <td class="cc-recommended"><button class="cc-btn cc-btn-solid" onclick="selectPlan('Standard', this)">Choose Standard</button></td>
          <td><button class="cc-btn cc-btn-outline" onclick="selectPlan('Premium', this)">Choose Premium</button></td>
        </tr>
      </tfoot>
    </table>
  </div>

  <div class="cc-selected" id="ccSelected" hidden></div>
</div>

Extend with AI

Take This Snippet Further With AI

The AI prompt for this one is for Patreon supporters ($3 a month), along with a site with no ads. Supporters enter the passcode once and it is remembered in this browser.

· Become a supporter

What's included

Features

Real semantic table
Built with thead/tbody/tfoot so screen readers get proper row and column context.
Highlighted recommended column
A single .cc-recommended class shades and rounds one column consistently across every row.
Most popular badge
A small pill above the recommended header calls out the suggested plan without extra markup.
Checkmark benefit cells
Green checks and muted dashes scan far faster than repeated Yes/No text.
Per-plan pricing display
Prices get their own larger, bold styling with a muted "/mo" suffix for quick reading.
Selectable plans
Choose buttons in the table footer confirm a selection and disable to show the active choice.
Horizontal scroll fallback
Narrow viewports scroll the table instead of cramming three columns into unreadable widths.
Framework-portable markup
Plain table markup with utility classes drops cleanly into React, Vue, or Tailwind.

About this UI Snippet

Insurance Coverage Comparison Table — A Highlighted Plan Table for Coverage Decisions

Screenshot of the Insurance Coverage Comparison Table snippet rendered live

Buying insurance is a spreadsheet decision dressed up as a purchase — people want to line up deductibles, limits, and benefits side by side before they commit. This snippet is a three-plan comparison table (Basic, Standard, Premium) built in plain HTML, CSS, and a sprinkle of vanilla JavaScript, with a visually highlighted "Standard" column, checkmark and dash cells for included benefits, and a selection action per plan.

A semantic table, not a div grid

The comparison uses a real <table> with <thead>, <tbody>, and <tfoot> — row labels down the left, plans across the top. That's deliberate: a genuine table is navigable by screen readers with row/column context, reflows sensibly, and is the correct semantic element for tabular data, unlike a flexbox row of "cards" that only looks like a table.

The recommended column

The middle "Standard" column carries a .cc-recommended class that tints its background, rounds its corners at the top and bottom, and adds a small "Most popular" badge above its header. Because the highlight is applied per-cell via a shared class rather than a separate table, the recommended column's shading lines up perfectly with every row without any extra markup.

Checkmarks and dashes, not text

Benefit rows ("Roadside assistance," "Accident forgiveness") use a green ✓ for included and a muted — for excluded, rather than "Yes"/"No" text. This is a scanning optimization: eyes pick out the shape and color of a checkmark column far faster than reading repeated words, which matters when a shopper is comparing six or more benefit rows across three plans.

Selecting a plan

Each plan has a "Choose" button in the table footer. Clicking one calls selectPlan, which shows a confirmation message and disables that button (re-enabling any previously selected one) so only one plan can be "chosen" at a time in this demo — swap the confirmation for a real navigation to checkout in production.

Responsive without breaking the table

On narrow viewports, .cc-table-scroll lets the table scroll horizontally rather than squeezing three price columns into a phone width, which would make numbers unreadable. Padding and font-size shrink slightly under 640px, but the table itself never wraps into cards, keeping row-to-row comparison intact at every width.

Pair this with a pricing feature table for SaaS-style plans, an insurance quote calculator to estimate a premium before comparing, or a comparison table for a more general product comparison.

Step by step

How to Use

  1. 1
    Paste HTML, CSS, and JSA three-column plan table renders with Standard highlighted and badged "Most popular".
  2. 2
    Scan the benefit rowsGreen checkmarks and muted dashes show which benefits each plan includes at a glance.
  3. 3
    Compare pricingMonthly premium, coverage limit, and deductible are aligned in the top rows for quick comparison.
  4. 4
    Choose a planClick a "Choose" button — a confirmation message appears and that button disables.
  5. 5
    Resize the windowBelow 640px the table scrolls horizontally instead of squeezing columns unreadably.
  6. 6
    Swap in real plansReplace the row values and benefit checks with your own plan data.

Real-world uses

Common Use Cases

Auto and home insurance plans
Compare Basic, Standard and Premium side by side, with deductibles, limits and benefits in a semantic thead, tbody and tfoot table.
Health insurance tiers
Compare HMO or PPO-style tiers, highlighting one recommended column with a single class and a most popular pill above it.
Warranty and protection plans
Reuse the structure for extended warranties, with green checks and muted dashes scanning faster than repeated yes and no text.
Quote flow pairing
Follow an insurance quote calculator with this table so a computed price leads into a plan comparison.
Pricing and product comparisons
Reuse the highlighted-column pattern for SaaS tiers like a pricing feature table, or strip the insurance wording for a general comparison table.
Related: Table with Scroll Shadow Indicators
See the Table with Scroll Shadow Indicators for a related tables pattern worth pairing with this one.
Related: Formula-Calculated Columns Table
See the Formula-Calculated Columns Table for a related tables pattern worth pairing with this one.
Related: Table with Sticky Footer Totals Row
See the Table with Sticky Footer Totals Row for a related tables pattern worth pairing with this one.

Got questions?

Frequently Asked Questions

A table gives screen readers native row and column relationships — a user can navigate by "monthly premium, Standard plan" cell by cell. A grid of divs styled to look like a table loses that structure entirely unless you manually add a large set of ARIA table roles, so starting with a real table is simpler and more robust.

Move the cc-recommended class from the Standard column's cells to whichever plan you want highlighted — each row's corresponding cell needs the class. Since the highlight is per-cell rather than a separate element, moving it is a find-and-replace on the class name, not a markup restructure.

Replace the confirmation message inside selectPlan with a redirect (window.location.href = '/checkout?plan=' + name) or a router push in your framework. Keep the disabled-button feedback if the button also needs to reflect a selection state before navigation completes.

Yes — each row is an independent tr, so add or remove rows freely. Just remember to add the cc-recommended class to that row's middle cell to keep the highlighted column's shading continuous down the table.

Map an array of plan objects into the table columns and an array of benefit rows into tbody rows, applying the recommended class conditionally based on a plan's "featured" flag. The CSS classes and table structure port unchanged; only the static markup becomes a loop.