Source Code

<div class="lmc-wrap">
  <div class="lmc-scroll">
    <table class="lmc-table">
      <thead>
        <tr>
          <th class="lmc-attr-col">Attribute</th>
          <th>Fast</th>
          <th class="lmc-recommended-col">
            <span class="lmc-rec-badge">Recommended</span>
            Balanced
          </th>
          <th>Advanced</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td class="lmc-attr-col">Context window</td>
          <td>32K tokens</td>
          <td class="lmc-recommended-col">128K tokens</td>
          <td>1M tokens</td>
        </tr>
        <tr>
          <td class="lmc-attr-col">Speed</td>
          <td><span class="lmc-dots"><span class="lmc-dot lmc-on"></span><span class="lmc-dot lmc-on"></span><span class="lmc-dot lmc-on"></span><span class="lmc-dot"></span><span class="lmc-dot"></span></span></td>
          <td class="lmc-recommended-col"><span class="lmc-dots"><span class="lmc-dot lmc-on"></span><span class="lmc-dot lmc-on"></span><span class="lmc-dot"></span><span class="lmc-dot"></span><span class="lmc-dot"></span></span></td>
          <td><span class="lmc-dots"><span class="lmc-dot lmc-on"></span><span class="lmc-dot"></span><span class="lmc-dot"></span><span class="lmc-dot"></span><span class="lmc-dot"></span></span></td>
        </tr>
        <tr>
          <td class="lmc-attr-col">Relative cost</td>
          <td><span class="lmc-cost">$</span><span class="lmc-cost lmc-off">$</span><span class="lmc-cost lmc-off">$</span></td>
          <td class="lmc-recommended-col"><span class="lmc-cost">$</span><span class="lmc-cost">$</span><span class="lmc-cost lmc-off">$</span></td>
          <td><span class="lmc-cost">$</span><span class="lmc-cost">$</span><span class="lmc-cost">$</span></td>
        </tr>
        <tr>
          <td class="lmc-attr-col">Best for</td>
          <td class="lmc-strength">Quick replies, autocomplete, high-volume tasks</td>
          <td class="lmc-recommended-col lmc-strength">Everyday chat, drafting, and general reasoning</td>
          <td class="lmc-strength">Deep analysis, long documents, complex reasoning</td>
        </tr>
      </tbody>
    </table>
  </div>
</div>

AI Model Comparison Table — Free HTML CSS JS Snippet

AI Model Comparison Table · Tables · Plain HTML, CSS & JS · Live preview

What's included

Features

Three generic AI model tiers (Fast, Balanced, Advanced) compared across four attributes
Speed shown as a five-dot filled/unfilled indicator instead of a raw number
Relative cost shown as styled dollar-sign groups (active vs. faded) per tier
One column visually promoted with a "Recommended" badge and accent border
Fully static, hand-authored comparison markup that is simple to edit directly
Horizontally scrollable container so the table stays usable on narrow screens
Row hover highlighting for easier scanning on wider viewports
Clean, accessible table semantics with a proper thead/tbody structure

About this UI Snippet

AI Model Comparison Table — Compare AI Model Tiers by Speed, Cost & Context

Screenshot of the AI Model Comparison Table snippet rendered live

Products that offer multiple AI model tiers (a fast/cheap option, a balanced default, and a slower/more capable option) usually need a compact way to help users pick one. This snippet lays out three generic tiers — Fast, Balanced, and Advanced — as columns against four attributes as rows, using visual encodings instead of dense text wherever a number alone would be harder to scan.

Dots and dollar signs instead of raw numbers

Rather than printing "Speed: 8/10", the speed row renders five small dot spans per model, with a variable number carrying the .lmc-on class to appear filled versus the rest staying an empty gray — a quick visual bar built from plain <span> elements and one CSS class, no chart library involved. Cost uses the same idea with dollar-sign characters, styling unused signs a faint gray so "$" vs "$$$" reads at a glance as relative cost tier.

One column visually promoted as Recommended

The Balanced column gets a small uppercase "Recommended" badge in its header cell and a distinct light-indigo background plus a 2px indigo border running down both sides of that column (applied via the .lmc-recommended-col class on every cell in that column, including the top and bottom border pieces on the header and last row) — drawing the eye to one clear default choice without needing JavaScript to compute or highlight anything.

Static markup, minimal JS

Because the content here is a fixed comparison rather than dynamic data, the table is authored directly in HTML with no data-driven rendering step. The included JS is intentionally light — just a row hover highlight for readability — so the snippet is trivial to adapt by editing the table cells directly.

Step by step

How to Use

  1. 1
    Load the snippetClick "AI Model Comparison Table" in the sidebar to load its HTML, CSS, and JS into the editor panels. The preview updates instantly.
  2. 2
    Edit the codeModify any panel — HTML, CSS, or JS. The preview refreshes as you type. Use Reset in each panel header to restore the original.
  3. 3
    Preview on devicesClick the Mobile (375px), Tablet (768px), or Desktop buttons in the preview header to check responsiveness.
  4. 4
    Export in your formatClick "HTML" to download a standalone file, "JSX" for a React component, "Tailwind" for a React + Tailwind CSS component, "Tailwind HTML" for a standalone HTML file with Tailwind CDN, "Vue" for a Vue 3 SFC with <template>/<script setup>/<style scoped>, or "Angular" for a standalone Angular .component.ts file. "Copy all" copies the full code to clipboard.
  5. 5
    Save your versionClick "Save as", type a name, and press Enter. Your snippet saves to IndexedDB and appears in the Saved tab.

Real-world uses

Common Use Cases

AI product pricing and plan pages
Help users choose between model tiers with the same visual pattern as a pricing table.
Model picker documentation and dev portals
Give developers an at-a-glance comparison before they pick a default model for an integration.
Internal AI tooling and admin dashboards
Show teams the trade-offs between available model options in one place.
Teaching visual data encoding in plain HTML/CSS
A clear example of representing relative values (speed, cost) with dots and symbols instead of numbers.

Got questions?

Frequently Asked Questions

No — Fast, Balanced, and Advanced are generic placeholder tier names. Replace them, and the values in each row, with your own actual model names and specs.

Each cell renders five small <span> "dot" elements; a subset of them carry the .lmc-on class to appear filled indigo while the rest stay a light gray, forming a simple visual bar without any chart library.

Move the lmc-recommended-col class (and the "Recommended" badge markup in the header) from the current column's cells to the cells of whichever column should be highlighted instead.

Yes — the table sits inside a horizontally scrollable container with a minimum width, so on narrow screens it can be scrolled sideways rather than being crushed illegibly.