---
id: seed:patterns/comparison-tables
title: Comparison tables
source_type: seed_pattern
priority: warm
---

A comparison table is a high-friction, high-signal element. It works on visitors in late-stage evaluation and is wasted on visitors who arrived 30 seconds ago. Four working variations:

---

**Tier comparison (vertical).** Pricing tiers as columns, features as rows with checkmarks, dashes, or text limits.

*Animation & Visual Details:*
- *Entrance*: Table rows stagger in from translateY(20px), 0.05s between each
- *Hover*: Row highlights with gradient background (accent at 5% opacity)
- *Gradients*: Featured/recommended column has gradient header (accent colors at 10%)
- *Radial circles*: Checkmarks have radial dot behind them
- *Scroll trigger*: IntersectionObserver at 10% threshold
- *JS interaction*: Tooltip on row header hover for feature explanations

```html
<section data-amb-section="comparison" class="compare-section">
  <div class="container">
    <h2 class="compare-title">Compare plans</h2>
    <div class="compare-table-wrapper">
      <table class="compare-table">
        <thead>
          <tr>
            <th class="compare-feature-col">Feature</th>
            <th class="compare-col">
              <span class="compare-tier-name">Starter</span>
              <span class="compare-tier-price">$9<span>/mo</span></span>
            </th>
            <th class="compare-col compare-col--featured">
              <div class="compare-recommended-badge">Recommended</div>
              <span class="compare-tier-name">Pro</span>
              <span class="compare-tier-price">$29<span>/mo</span></span>
            </th>
            <th class="compare-col">
              <span class="compare-tier-name">Enterprise</span>
              <span class="compare-tier-price">$99<span>/mo</span></span>
            </th>
          </tr>
        </thead>
        <tbody>
          <tr class="compare-category-row">
            <td colspan="4">Core Features</td>
          </tr>
          <tr class="compare-row">
            <th scope="row">
              <span class="compare-feature-name">Projects</span>
              <button class="compare-feature-tooltip" aria-label="What are projects?">
                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>
              </button>
            </th>
            <td>5</td>
            <td>Unlimited</td>
            <td>Unlimited</td>
          </tr>
          <tr class="compare-row">
            <th scope="row">
              <span class="compare-feature-name">Team members</span>
            </th>
            <td>3</td>
            <td>10</td>
            <td>Unlimited</td>
          </tr>
          <tr class="compare-row">
            <th scope="row">
              <span class="compare-feature-name">Storage</span>
            </th>
            <td>10 GB</td>
            <td>100 GB</td>
            <td>1 TB</td>
          </tr>
          <tr class="compare-row">
            <th scope="row">
              <span class="compare-feature-name">API access</span>
            </th>
            <td>
              <span class="compare-check">
                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
              </span>
            </td>
            <td>
              <span class="compare-check">
                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
              </span>
            </td>
            <td>
              <span class="compare-check">
                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
              </span>
            </td>
          </tr>
          <tr class="compare-category-row">
            <td colspan="4">Advanced</td>
          </tr>
          <tr class="compare-row">
            <th scope="row">
              <span class="compare-feature-name">Custom domains</span>
            </th>
            <td>1</td>
            <td>5</td>
            <td>Unlimited</td>
          </tr>
          <tr class="compare-row">
            <th scope="row">
              <span class="compare-feature-name">Analytics</span>
            </th>
            <td>Basic</td>
            <td>Advanced</td>
            <td>Custom</td>
          </tr>
          <tr class="compare-row">
            <th scope="row">
              <span class="compare-feature-name">Priority support</span>
            </th>
            <td>
              <span class="compare-dash">—</span>
            </td>
            <td>
              <span class="compare-check">
                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
              </span>
            </td>
            <td>
              <span class="compare-check">
                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
              </span>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</section>
```

```css
:root {
  --compare-enter-duration: 0.4s;
  --compare-stagger: 0.05s;
}

.compare-section {
  padding: clamp(64px, 8vw, 100px) 0;
  background: var(--color-bg-alt, #f8fafc);
}

.compare-title {
  text-align: center;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--color-text, #1e293b);
  margin-bottom: 40px;
}

.compare-table-wrapper {
  max-width: 900px;
  margin: 0 auto;
  overflow-x: auto;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.compare-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
}

.compare-feature-col {
  text-align: left;
  padding: 20px 24px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #e2e8f0;
  width: 40%;
}

.compare-col {
  text-align: center;
  padding: 24px 20px;
  border-bottom: 1px solid #e2e8f0;
  opacity: 0;
  transform: translateY(10px);
}

.compare-col.is-visible {
  animation: compare-col-enter var(--compare-enter-duration) ease-out forwards;
}

.compare-feature-col.is-visible {
  animation-delay: 0s;
}

.compare-col:nth-child(2).is-visible { animation-delay: var(--compare-stagger); }
.compare-col:nth-child(3).is-visible { animation-delay: calc(var(--compare-stagger) * 2); }
.compare-col:nth-child(4).is-visible { animation-delay: calc(var(--compare-stagger) * 3); }

@keyframes compare-col-enter {
  to { opacity: 1; transform: translateY(0); }
}

.compare-col--featured {
  background: linear-gradient(180deg, rgba(99,102,241,0.05) 0%, transparent 100%);
  position: relative;
}

.compare-recommended-badge {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  background: linear-gradient(135deg, var(--color-accent, #6366f1), #7c3aed);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 0 0 8px 8px;
}

.compare-tier-name {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text, #1e293b);
  margin-bottom: 8px;
}

.compare-tier-price {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent, #6366f1);
}

.compare-tier-price span {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-text-muted, #64748b);
}

.compare-category-row td {
  padding: 16px 24px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.compare-row {
  opacity: 0;
  transform: translateY(10px);
  transition: background 0.2s ease;
}

.compare-row.is-visible {
  animation: compare-row-enter var(--compare-enter-duration) ease-out forwards;
}

.compare-row:nth-child(odd).is-visible { animation-delay: calc(var(--compare-stagger) * 4); }
.compare-row:nth-child(even).is-visible { animation-delay: calc(var(--compare-stagger) * 5); }

@keyframes compare-row-enter {
  to { opacity: 1; transform: translateY(0); }
}

.compare-row:hover {
  background: rgba(99,102,241,0.03);
}

.compare-row th {
  text-align: left;
  padding: 16px 24px;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--color-text, #1e293b);
}

.compare-row td {
  text-align: center;
  padding: 16px 20px;
  font-size: 0.9rem;
  color: var(--color-text, #1e293b);
}

.compare-feature-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.compare-feature-tooltip {
  width: 16px;
  height: 16px;
  border: none;
  background: none;
  color: var(--color-text-muted, #64748b);
  cursor: pointer;
  padding: 0;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.compare-feature-tooltip:hover {
  opacity: 1;
}

.compare-feature-tooltip svg {
  width: 100%;
  height: 100%;
}

.compare-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  position: relative;
}

.compare-check::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.compare-check svg {
  width: 18px;
  height: 18px;
  color: var(--color-accent, #6366f1);
}

.compare-dash {
  color: var(--color-text-muted, #64748b);
}

@media (prefers-reduced-motion: reduce) {
  .compare-col,
  .compare-row {
    opacity: 1;
    transform: none;
  }
}
```

*JS behavior:*
```javascript
const tableElements = document.querySelectorAll('.compare-col, .compare-row, .compare-feature-col');
const observer = new IntersectionObserver((entries) => {
  entries.forEach(entry => {
    if (entry.isIntersecting) {
      entry.target.classList.add('is-visible');
      observer.unobserve(entry.target);
    }
  });
}, { threshold: 0.1 });
tableElements.forEach(el => observer.observe(el));

const tooltipBtns = document.querySelectorAll('.compare-feature-tooltip');
tooltipBtns.forEach(btn => {
  btn.addEventListener('click', (e) => {
    const featureName = btn.closest('th').querySelector('.compare-feature-name').textContent;
    alert(`${featureName}: Full access to this feature is included in your plan.`);
  });
});
```

---

**Horizontal card comparison.** Side-by-side cards showing your product vs competitor.

*Animation & Visual Details:*
- *Entrance*: Your card slides in from right, competitor from left, 0.2s delay
- *Hover*: Feature rows highlight with gradient on hover
- *Gradients*: Your card has gradient border (accent); competitor has muted border
- *Radial circles*: Radial glow behind your card header
- *Scroll trigger*: IntersectionObserver at 20% threshold
- *JS interaction*: None beyond entrance

```html
<section data-amb-section="comparison" class="compare-section compare-section--cards">
  <div class="container">
    <h2 class="compare-title">How we compare</h2>
    <div class="compare-cards">
      <div class="compare-card compare-card--competitor">
        <div class="compare-card-header">
          <span class="compare-card-label">Competitors</span>
          <h3 class="compare-card-name">Traditional tools</h3>
        </div>
        <ul class="compare-card-list">
          <li class="compare-card-item">
            <span class="compare-card-item-icon compare-card-item-icon--bad">
              <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
            </span>
            <span class="compare-card-item-text">Manual deployments</span>
          </li>
          <li class="compare-card-item">
            <span class="compare-card-item-icon compare-card-item-icon--bad">
              <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
            </span>
            <span class="compare-card-item-text">No rollbacks</span>
          </li>
          <li class="compare-card-item">
            <span class="compare-card-item-icon compare-card-item-icon--bad">
              <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
            </span>
            <span class="compare-card-item-text">Spreadsheet tracking</span>
          </li>
          <li class="compare-card-item">
            <span class="compare-card-item-icon compare-card-item-icon--bad">
              <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
            </span>
            <span class="compare-card-item-text">48hr average incident response</span>
          </li>
        </ul>
      </div>
      <div class="compare-card compare-card--us">
        <div class="compare-card-glow"></div>
        <div class="compare-card-header">
          <span class="compare-card-label">That's us</span>
          <h3 class="compare-card-name">Acme Platform</h3>
        </div>
        <ul class="compare-card-list">
          <li class="compare-card-item">
            <span class="compare-card-item-icon compare-card-item-icon--good">
              <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
            </span>
            <span class="compare-card-item-text">One-click automated deployments</span>
          </li>
          <li class="compare-card-item">
            <span class="compare-card-item-icon compare-card-item-icon--good">
              <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
            </span>
            <span class="compare-card-item-text">Instant rollback on failure</span>
          </li>
          <li class="compare-card-item">
            <span class="compare-card-item-icon compare-card-item-icon--good">
              <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
            </span>
            <span class="compare-card-item-text">Real-time dashboards</span>
          </li>
          <li class="compare-card-item">
            <span class="compare-card-item-icon compare-card-item-icon--good">
              <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
            </span>
            <span class="compare-card-item-text">5-minute average incident response</span>
          </li>
        </ul>
        <a href="#" class="compare-card-cta">Start free trial</a>
      </div>
    </div>
  </div>
</section>
```

```css
.compare-section--cards {
  background: #fff;
}

.compare-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .compare-cards { grid-template-columns: 1fr; }
}

.compare-card {
  position: relative;
  border-radius: 20px;
  padding: 32px;
  opacity: 0;
}

.compare-card--competitor {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  transform: translateX(-40px);
}

.compare-card--us {
  background: linear-gradient(135deg, rgba(99,102,241,0.03), rgba(124,58,237,0.01));
  border: 1px solid rgba(99,102,241,0.2);
  transform: translateX(40px);
}

.compare-card.is-visible {
  animation: compare-card-enter 0.5s ease-out forwards;
}

.compare-card--competitor.is-visible { animation-delay: 0s; }
.compare-card--us.is-visible { animation-delay: 0.15s; }

@keyframes compare-card-enter {
  to { opacity: 1; transform: translateX(0); }
}

.compare-card-glow {
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.compare-card-header {
  margin-bottom: 24px;
}

.compare-card-label {
  display: inline-block;
  padding: 4px 10px;
  background: #e2e8f0;
  color: var(--color-text-muted, #64748b);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 12px;
  margin-bottom: 8px;
}

.compare-card--us .compare-card-label {
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(124,58,237,0.1));
  color: var(--color-accent, #6366f1);
}

.compare-card-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text, #1e293b);
  margin: 0;
}

.compare-card-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.compare-card-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: background 0.2s ease;
}

.compare-card-item:last-child {
  border-bottom: none;
}

.compare-card-item:hover {
  background: rgba(99,102,241,0.03);
  margin: 0 -12px;
  padding-left: 12px;
  padding-right: 12px;
  border-radius: 8px;
}

.compare-card-item-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compare-card-item-icon--bad {
  background: rgba(239,68,68,0.1);
  color: #ef4444;
}

.compare-card-item-icon--good {
  background: rgba(34,197,94,0.1);
  position: relative;
}

.compare-card-item-icon--good::before {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: radial-gradient(circle, rgba(34,197,94,0.2) 0%, transparent 70%);
  border-radius: 50%;
}

.compare-card-item-icon svg {
  width: 14px;
  height: 14px;
}

.compare-card-item-text {
  font-size: 0.9rem;
  color: var(--color-text, #1e293b);
}

.compare-card-cta {
  display: block;
  text-align: center;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--color-accent, #6366f1), #7c3aed);
  color: #fff;
  font-weight: 600;
  border-radius: 12px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.compare-card-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.3);
}

@media (prefers-reduced-motion: reduce) {
  .compare-card {
    opacity: 1;
    transform: none;
  }
}
```

*JS behavior:*
```javascript
const compareCards = document.querySelectorAll('.compare-card');
const observer = new IntersectionObserver((entries) => {
  entries.forEach(entry => {
    if (entry.isIntersecting) {
      entry.target.classList.add('is-visible');
      observer.unobserve(entry.target);
    }
  });
}, { threshold: 0.2 });
compareCards.forEach(card => observer.observe(card));
```

---

**Interactive feature filter.** Toggle to show/hide feature categories in the comparison table.

*Animation & Visual Details:*
- *Entrance*: Filter chips fade in first; table rows follow
- *Hover*: Chips have gradient border on hover
- *Gradients*: Active chip has gradient background (accent at 10%)
- *Radial circles*: Radial dot on active chip
- *Scroll trigger*: IntersectionObserver at 15% threshold
- *JS interaction*: Category filter toggles table row visibility

```html
<section data-amb-section="comparison" class="compare-section compare-section--filter">
  <div class="container">
    <h2 class="compare-title">Full feature comparison</h2>
    <div class="compare-filters">
      <button class="compare-filter-btn compare-filter-btn--active" data-filter="all">All features</button>
      <button class="compare-filter-btn" data-filter="core">Core</button>
      <button class="compare-filter-btn" data-filter="advanced">Advanced</button>
      <button class="compare-filter-btn" data-filter="support">Support</button>
    </div>
    <div class="compare-table-wrapper">
      <table class="compare-table">
        <thead>
          <tr>
            <th class="compare-feature-col">Feature</th>
            <th>Starter</th>
            <th>Pro</th>
            <th>Enterprise</th>
          </tr>
        </thead>
        <tbody>
          <tr class="compare-row" data-categories="core">
            <th scope="row">Projects</th>
            <td>5</td>
            <td>Unlimited</td>
            <td>Unlimited</td>
          </tr>
          <tr class="compare-row" data-categories="core">
            <th scope="row">Team members</th>
            <td>3</td>
            <td>10</td>
            <td>Unlimited</td>
          </tr>
          <tr class="compare-row" data-categories="advanced">
            <th scope="row">Custom domains</th>
            <td>1</td>
            <td>5</td>
            <td>Unlimited</td>
          </tr>
          <tr class="compare-row" data-categories="advanced">
            <th scope="row">API access</th>
            <td>
              <span class="compare-check">
                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
              </span>
            </td>
            <td>
              <span class="compare-check">
                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
              </span>
            </td>
            <td>
              <span class="compare-check">
                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
              </span>
            </td>
          </tr>
          <tr class="compare-row" data-categories="support">
            <th scope="row">Email support</th>
            <td>
              <span class="compare-check">
                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
              </span>
            </td>
            <td>
              <span class="compare-check">
                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
              </span>
            </td>
            <td>
              <span class="compare-check">
                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
              </span>
            </td>
          </tr>
          <tr class="compare-row" data-categories="support">
            <th scope="row">Priority support</th>
            <td>—</td>
            <td>
              <span class="compare-check">
                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
              </span>
            </td>
            <td>
              <span class="compare-check">
                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
              </span>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</section>
```

```css
.compare-section--filter {
  background: var(--color-bg-alt, #f8fafc);
}

.compare-filters {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
  opacity: 0;
  animation: compare-filters-enter 0.4s ease-out 0.2s forwards;
}

@keyframes compare-filters-enter {
  to { opacity: 1; }
}

.compare-filter-btn {
  padding: 10px 20px;
  border-radius: 24px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted, #64748b);
  cursor: pointer;
  transition: all 0.2s ease;
}

.compare-filter-btn:hover {
  border-color: var(--color-accent, #6366f1);
  color: var(--color-accent, #6366f1);
}

.compare-filter-btn--active {
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(124,58,237,0.08));
  border-color: var(--color-accent, #6366f1);
  color: var(--color-accent, #6366f1);
}

.compare-filter-btn--active::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: radial-gradient(circle, var(--color-accent, #6366f1) 0%, rgba(99,102,241,0.4) 100%);
  border-radius: 50%;
  margin-right: 6px;
}

.compare-row[data-hidden="true"] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .compare-filters {
    animation: none;
    opacity: 1;
  }
}
```

*JS behavior:*
```javascript
const filterBtns = document.querySelectorAll('.compare-filter-btn');
const tableRows = document.querySelectorAll('.compare-row');

const observer = new IntersectionObserver((entries) => {
  entries.forEach(entry => {
    if (entry.isIntersecting) {
      entry.target.classList.add('is-visible');
      observer.unobserve(entry.target);
    }
  });
}, { threshold: 0.1 });
tableRows.forEach(row => observer.observe(row));

filterBtns.forEach(btn => {
  btn.addEventListener('click', () => {
    const filter = btn.dataset.filter;

    filterBtns.forEach(b => b.classList.remove('compare-filter-btn--active'));
    btn.classList.add('compare-filter-btn--active');

    tableRows.forEach(row => {
      const categories = row.dataset.categories;
      const shouldShow = filter === 'all' || categories.includes(filter);
      row.dataset.hidden = shouldShow ? 'false' : 'true';

      if (shouldShow) {
        row.style.animation = 'none';
        row.offsetHeight;
        row.classList.remove('is-visible');
        row.style.animation = '';
        void row.offsetWidth;
        row.classList.add('is-visible');
      }
    });
  });
});
```

---

**Sticky header table.** Long table with sticky header and scroll indicator.

*Animation & Visual Details:*
- *Entrance*: Table fades in with scale 0.98 → 1
- *Scroll*: Header sticks to top; scroll progress indicator at bottom
- *Gradients*: Column headers have gradient background
- *Radial circles*: Progress indicator has radial fill
- *Scroll trigger*: Not applicable (scroll-based sticky)
- *JS interaction*: Scroll progress updates progress bar

```html
<section data-amb-section="comparison" class="compare-section compare-section--sticky">
  <div class="container">
    <h2 class="compare-title">Technical specifications</h2>
    <p class="compare-subtitle">Everything you need to know about our platform capabilities</p>
    <div class="compare-table-container" id="compare-table-container">
      <table class="compare-table">
        <thead>
          <tr>
            <th class="compare-feature-col">Specification</th>
            <th>Starter</th>
            <th>Pro</th>
            <th>Enterprise</th>
          </tr>
        </thead>
        <tbody>
          <tr><th scope="row">Uptime SLA</th><td>99.5%</td><td>99.9%</td><td>99.99%</td></tr>
          <tr><th scope="row">Support response</th><td>24 hours</td><td>4 hours</td><td>1 hour</td></tr>
          <tr><th scope="row">Data retention</th><td>30 days</td><td>1 year</td><td>Unlimited</td></tr>
          <tr><th scope="row">Team seats</th><td>Up to 5</td><td>Up to 25</td><td>Unlimited</td></tr>
          <tr><th scope="row">API rate limit</th><td>100/min</td><td>1000/min</td><td>Custom</td></tr>
          <tr><th scope="row">SSO integration</th><td>—</td><td>SAML</td><td>SAML + OAuth</td></tr>
          <tr><th scope="row">Audit logs</th><td>7 days</td><td>90 days</td><td>1 year</td></tr>
          <tr><th scope="row">Custom contracts</th><td>—</td><td>—</td><td>
            <span class="compare-check">
              <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
            </span>
          </td></tr>
          <tr><th scope="row">Dedicated account manager</th><td>—</td><td>—</td><td>
            <span class="compare-check">
              <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
            </span>
          </td></tr>
          <tr><th scope="row">Custom SLA terms</th><td>—</td><td>—</td><td>
            <span class="compare-check">
              <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
            </span>
          </td></tr>
        </tbody>
      </table>
      <div class="compare-scroll-progress">
        <div class="compare-scroll-progress-bar"></div>
      </div>
    </div>
  </div>
</section>
```

```css
.compare-section--sticky {
  background: #fff;
}

.compare-subtitle {
  text-align: center;
  color: var(--color-text-muted, #64748b);
  margin: -24px auto 32px;
  max-width: 500px;
}

.compare-table-container {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  opacity: 0;
  transform: scale(0.98);
  animation: compare-table-enter 0.5s ease-out 0.3s forwards;
}

@keyframes compare-table-enter {
  to { opacity: 1; transform: scale(1); }
}

.compare-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(124,58,237,0.04));
}

.compare-table thead th {
  padding: 20px 24px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text, #1e293b);
  border-bottom: 2px solid var(--color-accent, #6366f1);
}

.compare-feature-col {
  background: #fff;
}

.compare-row th,
.compare-row td {
  padding: 16px 24px;
  border-bottom: 1px solid #f1f5f9;
}

.compare-row th {
  font-weight: 400;
  text-align: left;
}

.compare-row td {
  text-align: center;
}

.compare-scroll-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #f1f5f9;
}

.compare-scroll-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-accent, #6366f1), #7c3aed);
  transition: width 0.1s ease;
}

.compare-check svg {
  width: 20px;
  height: 20px;
  color: var(--color-accent, #6366f1);
}

@media (prefers-reduced-motion: reduce) {
  .compare-table-container {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .compare-scroll-progress-bar {
    transition: none;
  }
}
```

*JS behavior:*
```javascript
const container = document.getElementById('compare-table-container');
const progressBar = container.querySelector('.compare-scroll-progress-bar');

container.addEventListener('scroll', () => {
  const scrollLeft = container.scrollLeft;
  const maxScroll = container.scrollWidth - container.clientWidth;
  const progress = (scrollLeft / maxScroll) * 100;
  progressBar.style.width = `${progress}%`;
});
```

---

Copy rules: compare your product to the competitor's actual offering, not a strawman version. Group features by category. Use specific values, not vague checkmarks. Highlight your recommended tier without making competitors look deliberately weak.

Layout rules: comparison tables belong mid-to-low page after the visitor understands the category. Never put one in the hero — the visitor needs context first. Keep horizontal scroll clean on mobile or collapse to per-tier cards.

CSS custom property summary:
```css
:root {
  --compare-enter-duration: 0.4s;
  --compare-stagger: 0.05s;
  --color-accent: #6366f1;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
}
```