Component

Compact Table

Dense cryptocurrency market data table with compact spacing. Features cryptocurrency logos, inline sparkline charts, percentage changes with color coding, and efficient use of horizontal space.

  • Component
  • Tailwind
  • HTML
  • MIT

Preview

Live component

Interactive preview
Open preview
9:41 100%
devsnips.dev/library/tailwind/components/tables/compact-table/
fluid · no fixed width 100%
No dependencies Production-ready

Install

Add to your project

terminal
npx devsnips add Tailwind/Components/Tables/compact-table
registry path: Tailwind/Components/Tables/compact-table

Source

Implementation

code.html
<div class="bg-white rounded-xl shadow-sm border border-gray-200 overflow-x-auto">
  <table class="w-full text-sm min-w-[640px]">
    <thead>
      <tr class="bg-gray-900 text-white">
        <th class="px-3 py-2.5 text-left text-[10px] font-semibold uppercase tracking-wide">#</th>
        <th class="px-3 py-2.5 text-left text-[10px] font-semibold uppercase tracking-wide">Symbol</th>
        <th class="px-3 py-2.5 text-left text-[10px] font-semibold uppercase tracking-wide">Name</th>
        <th class="px-3 py-2.5 text-right text-[10px] font-semibold uppercase tracking-wide">Price</th>
        <th class="px-3 py-2.5 text-right text-[10px] font-semibold uppercase tracking-wide">24h %</th>
        <th class="px-3 py-2.5 text-right text-[10px] font-semibold uppercase tracking-wide">Market Cap</th>
        <th class="px-3 py-2.5 text-right text-[10px] font-semibold uppercase tracking-wide">Volume</th>
        <th class="px-3 py-2.5 text-center text-[10px] font-semibold uppercase tracking-wide">7d Chart</th>
      </tr>
    </thead>
    <tbody class="divide-y divide-gray-100">
      <tr class="hover:bg-blue-50 transition-colors cursor-pointer">
        <td class="px-3 py-2 text-gray-400 font-medium">1</td>
        <td class="px-3 py-2">
          <div class="flex items-center gap-2">
            <div class="w-6 h-6 bg-orange-500 rounded-full flex items-center justify-center">
              <span class="text-[9px] font-bold text-white">₿</span>
            </div>
            <span class="font-semibold text-gray-900">BTC</span>
          </div>
        </td>
        <td class="px-3 py-2 text-gray-600">Bitcoin</td>
        <td class="px-3 py-2 text-right font-semibold text-gray-900">$67,842.50</td>
        <td class="px-3 py-2 text-right">
          <span class="text-emerald-600 font-medium">+2.34%</span>
        </td>
        <td class="px-3 py-2 text-right text-gray-600">$1.33T</td>
        <td class="px-3 py-2 text-right text-gray-600">$28.5B</td>
        <td class="px-3 py-2">
          <svg class="w-16 h-6 mx-auto text-emerald-500" viewBox="0 0 64 24">
            <polyline fill="none" stroke="currentColor" stroke-width="1.5" points="0,20 10,18 20,15 30,16 40,12 50,8 60,6 64,4"/>
          </svg>
        </td>
      </tr>
      <tr class="hover:bg-blue-50 transition-colors cursor-pointer">
        <td class="px-3 py-2 text-gray-400 font-medium">2</td>
        <td class="px-3 py-2">
          <div class="flex items-center gap-2">
            <div class="w-6 h-6 bg-blue-600 rounded-full flex items-center justify-center">
              <span class="text-[9px] font-bold text-white">E</span>
            </div>
            <span class="font-semibold text-gray-900">ETH</span>
          </div>
        </td>
        <td class="px-3 py-2 text-gray-600">Ethereum</td>
        <td class="px-3 py-2 text-right font-semibold text-gray-900">$3,521.80</td>
        <td class="px-3 py-2 text-right">
          <span class="text-emerald-600 font-medium">+1.87%</span>
        </td>
        <td class="px-3 py-2 text-right text-gray-600">$423.2B</td>
        <td class="px-3 py-2 text-right text-gray-600">$14.2B</td>
        <td class="px-3 py-2">
          <svg class="w-16 h-6 mx-auto text-emerald-500" viewBox="0 0 64 24">
            <polyline fill="none" stroke="currentColor" stroke-width="1.5" points="0,18 10,16 20,17 30,14 40,10 50,9 60,6 64,5"/>
          </svg>
        </td>
      </tr>
      <tr class="hover:bg-blue-50 transition-colors cursor-pointer">
        <td class="px-3 py-2 text-gray-400 font-medium">3</td>
        <td class="px-3 py-2">
          <div class="flex items-center gap-2">
            <div class="w-6 h-6 bg-sky-500 rounded-full flex items-center justify-center">
              <span class="text-[9px] font-bold text-white">T</span>
            </div>
            <span class="font-semibold text-gray-900">USDT</span>
          </div>
        </td>
        <td class="px-3 py-2 text-gray-600">Tether</td>
        <td class="px-3 py-2 text-right font-semibold text-gray-900">$1.00</td>
        <td class="px-3 py-2 text-right">
          <span class="text-gray-500 font-medium">0.01%</span>
        </td>
        <td class="px-3 py-2 text-right text-gray-600">$112.4B</td>
        <td class="px-3 py-2 text-right text-gray-600">$42.1B</td>
        <td class="px-3 py-2">
          <svg class="w-16 h-6 mx-auto text-gray-400" viewBox="0 0 64 24">
            <polyline fill="none" stroke="currentColor" stroke-width="1.5" points="0,12 10,12 20,12 30,12 40,12 50,12 60,12 64,12"/>
          </svg>
        </td>
      </tr>
      <tr class="hover:bg-blue-50 transition-colors cursor-pointer">
        <td class="px-3 py-2 text-gray-400 font-medium">4</td>
        <td class="px-3 py-2">
          <div class="flex items-center gap-2">
            <div class="w-6 h-6 bg-amber-500 rounded-full flex items-center justify-center">
              <span class="text-[9px] font-bold text-white">S</span>
            </div>
            <span class="font-semibold text-gray-900">SOL</span>
          </div>
        </td>
        <td class="px-3 py-2 text-gray-600">Solana</td>
        <td class="px-3 py-2 text-right font-semibold text-gray-900">$172.45</td>
        <td class="px-3 py-2 text-right">
          <span class="text-rose-600 font-medium">-3.21%</span>
        </td>
        <td class="px-3 py-2 text-right text-gray-600">$78.9B</td>
        <td class="px-3 py-2 text-right text-gray-600">$2.8B</td>
        <td class="px-3 py-2">
          <svg class="w-16 h-6 mx-auto text-rose-500" viewBox="0 0 64 24">
            <polyline fill="none" stroke="currentColor" stroke-width="1.5" points="0,8 10,10 20,8 30,12 40,14 50,16 60,18 64,20"/>
          </svg>
        </td>
      </tr>
      <tr class="hover:bg-blue-50 transition-colors cursor-pointer">
        <td class="px-3 py-2 text-gray-400 font-medium">5</td>
        <td class="px-3 py-2">
          <div class="flex items-center gap-2">
            <div class="w-6 h-6 bg-cyan-500 rounded-full flex items-center justify-center">
              <span class="text-[9px] font-bold text-white">X</span>
            </div>
            <span class="font-semibold text-gray-900">XRP</span>
          </div>
        </td>
        <td class="px-3 py-2 text-gray-600">XRP</td>
        <td class="px-3 py-2 text-right font-semibold text-gray-900">$0.5245</td>
        <td class="px-3 py-2 text-right">
          <span class="text-emerald-600 font-medium">+0.78%</span>
        </td>
        <td class="px-3 py-2 text-right text-gray-600">$28.7B</td>
        <td class="px-3 py-2 text-right text-gray-600">$1.2B</td>
        <td class="px-3 py-2">
          <svg class="w-16 h-6 mx-auto text-emerald-500" viewBox="0 0 64 24">
            <polyline fill="none" stroke="currentColor" stroke-width="1.5" points="0,16 10,15 20,14 30,15 40,12 50,10 60,8 64,7"/>
          </svg>
        </td>
      </tr>
      <tr class="hover:bg-blue-50 transition-colors cursor-pointer">
        <td class="px-3 py-2 text-gray-400 font-medium">6</td>
        <td class="px-3 py-2">
          <div class="flex items-center gap-2">
            <div class="w-6 h-6 bg-green-600 rounded-full flex items-center justify-center">
              <span class="text-[9px] font-bold text-white">BNB</span>
            </div>
            <span class="font-semibold text-gray-900">BNB</span>
          </div>
        </td>
        <td class="px-3 py-2 text-gray-600">BNB</td>
        <td class="px-3 py-2 text-right font-semibold text-gray-900">$598.20</td>
        <td class="px-3 py-2 text-right">
          <span class="text-emerald-600 font-medium">+1.12%</span>
        </td>
        <td class="px-3 py-2 text-right text-gray-600">$89.4B</td>
        <td class="px-3 py-2 text-right text-gray-600">$1.8B</td>
        <td class="px-3 py-2">
          <svg class="w-16 h-6 mx-auto text-emerald-500" viewBox="0 0 64 24">
            <polyline fill="none" stroke="currentColor" stroke-width="1.5" points="0,14 10,13 20,12 30,14 40,11 50,10 60,8 64,6"/>
          </svg>
        </td>
      </tr>
      <tr class="hover:bg-blue-50 transition-colors cursor-pointer">
        <td class="px-3 py-2 text-gray-400 font-medium">7</td>
        <td class="px-3 py-2">
          <div class="flex items-center gap-2">
            <div class="w-6 h-6 bg-rose-500 rounded-full flex items-center justify-center">
              <span class="text-[9px] font-bold text-white">ADA</span>
            </div>
            <span class="font-semibold text-gray-900">ADA</span>
          </div>
        </td>
        <td class="px-3 py-2 text-gray-600">Cardano</td>
        <td class="px-3 py-2 text-right font-semibold text-gray-900">$0.4521</td>
        <td class="px-3 py-2 text-right">
          <span class="text-rose-600 font-medium">-1.45%</span>
        </td>
        <td class="px-3 py-2 text-right text-gray-600">$16.2B</td>
        <td class="px-3 py-2 text-right text-gray-600">$412M</td>
        <td class="px-3 py-2">
          <svg class="w-16 h-6 mx-auto text-rose-500" viewBox="0 0 64 24">
            <polyline fill="none" stroke="currentColor" stroke-width="1.5" points="0,10 10,12 20,11 30,14 40,13 50,16 60,18 64,19"/>
          </svg>
        </td>
      </tr>
      <tr class="hover:bg-blue-50 transition-colors cursor-pointer">
        <td class="px-3 py-2 text-gray-400 font-medium">8</td>
        <td class="px-3 py-2">
          <div class="flex items-center gap-2">
            <div class="w-6 h-6 bg-violet-600 rounded-full flex items-center justify-center">
              <span class="text-[9px] font-bold text-white">D</span>
            </div>
            <span class="font-semibold text-gray-900">DOGE</span>
          </div>
        </td>
        <td class="px-3 py-2 text-gray-600">Dogecoin</td>
        <td class="px-3 py-2 text-right font-semibold text-gray-900">$0.1245</td>
        <td class="px-3 py-2 text-right">
          <span class="text-emerald-600 font-medium">+4.56%</span>
        </td>
        <td class="px-3 py-2 text-right text-gray-600">$17.8B</td>
        <td class="px-3 py-2 text-right text-gray-600">$892M</td>
        <td class="px-3 py-2">
          <svg class="w-16 h-6 mx-auto text-emerald-500" viewBox="0 0 64 24">
            <polyline fill="none" stroke="currentColor" stroke-width="1.5" points="0,18 10,16 20,14 30,15 40,10 50,8 60,5 64,4"/>
          </svg>
        </td>
      </tr>
    </tbody>
  </table>
</div>
202 lines UTF-8 · LF · Spaces: 2

AI-ready

Available to your agent.

This component is reachable through the DevSnips CLI, MCP server and Skills integrations — one registry, one resource path.

Resource path

devsnips://components/tables/compact-table

Continue browsing

View all