Tables

Base styling for HTML tables, plus the ln-table block for enhanced tables with sorting, selection, striping, and responsive stacking.

Base element defaults

Plain <table>, <th>, and <td> elements receive sensible defaults from @layer base. Tables are full-width with collapsed borders. Cells use box-shadow instead of real borders to stay on the 24px rhythm grid.

index.htmlhtml
<table>
  <caption>Base table — no classes needed</caption>
  <thead>
    <tr>
      <th>Token</th>
      <th>Value</th>
      <th>Purpose</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code>--s1</code></td>
      <td>0.5rem</td>
      <td>Tight spacing</td>
    </tr>
    <tr>
      <td><code>--s2</code></td>
      <td>1rem</td>
      <td>Default gap</td>
    </tr>
    <tr>
      <td><code>--s3</code></td>
      <td>1.5rem</td>
      <td>Section gap</td>
    </tr>
  </tbody>
</table>
Base table — no classes needed
TokenValuePurpose
--s10.5remTight spacing
--s21remDefault gap
--s31.5remSection gap

Striped table

index.htmlhtml
<div class="ln-table ln-table--striped">
  <table class="ln-table__grid">
    <thead>
      <tr>
        <th class="ln-table__header">Product</th>
        <th class="ln-table__header ln-table__header--numeric">SKU</th>
        <th class="ln-table__header ln-table__header--numeric">Price</th>
      </tr>
    </thead>
    <tbody>
      <tr class="ln-table__row">
        <td class="ln-table__cell">Wireless Headphones</td>
        <td class="ln-table__cell ln-table__cell--numeric ln-table__cell--mono">WH-1042</td>
        <td class="ln-table__cell ln-table__cell--numeric">$89.00</td>
      </tr>
      <tr class="ln-table__row">
        <td class="ln-table__cell">USB-C Hub</td>
        <td class="ln-table__cell ln-table__cell--numeric ln-table__cell--mono">UC-3391</td>
        <td class="ln-table__cell ln-table__cell--numeric">$45.00</td>
      </tr>
      <tr class="ln-table__row">
        <td class="ln-table__cell">Mechanical Keyboard</td>
        <td class="ln-table__cell ln-table__cell--numeric ln-table__cell--mono">MK-7780</td>
        <td class="ln-table__cell ln-table__cell--numeric">$129.00</td>
      </tr>
    </tbody>
  </table>
</div>
ProductSKUPrice
Wireless HeadphonesWH-1042$89.00
USB-C HubUC-3391$45.00
Mechanical KeyboardMK-7780$129.00

Table block — full-featured

The ln-table block wraps enhanced tables with modifiers for divided rows, sortable headers, row selection, and pagination. Modifiers include --divided, --striped, --bordered, --compact, --spacious, --sticky-header, and --sticky-first.

index.htmlhtml
<div class="ln-table ln-table--divided">
  <table class="ln-table__grid">
    <thead>
      <tr>
        <th class="ln-table__header ln-table__select">
          <input type="checkbox" class="ln-choice__input">
        </th>
        <th class="ln-table__header">
          <button class="ln-table__sort" aria-sort="ascending">Name</button>
        </th>
        <th class="ln-table__header">Role</th>
        <th class="ln-table__header">Status</th>
        <th class="ln-table__header ln-table__header--numeric">Hours</th>
      </tr>
    </thead>
    <tbody>
      <tr class="ln-table__row" aria-selected="true">
        <td class="ln-table__cell ln-table__select">
          <input type="checkbox" class="ln-choice__input" checked>
        </td>
        <td class="ln-table__cell">
          <span class="d-flex align-items-center gap-2">
            <span class="ln-avatar ln-avatar--sm">AJ</span>
            Alice Johnson
          </span>
        </td>
        <td class="ln-table__cell">Engineer</td>
        <td class="ln-table__cell">
          <span class="ln-badge ln-badge--success">Active</span>
        </td>
        <td class="ln-table__cell ln-table__cell--numeric">142</td>
      </tr>
      <tr class="ln-table__row" aria-selected="true">
        <td class="ln-table__cell ln-table__select">
          <input type="checkbox" class="ln-choice__input" checked>
        </td>
        <td class="ln-table__cell">
          <span class="d-flex align-items-center gap-2">
            <span class="ln-avatar ln-avatar--sm">BS</span>
            Bob Smith
          </span>
        </td>
        <td class="ln-table__cell">Designer</td>
        <td class="ln-table__cell">
          <span class="ln-badge ln-badge--warning">Away</span>
        </td>
        <td class="ln-table__cell ln-table__cell--numeric">98</td>
      </tr>
      <tr class="ln-table__row">
        <td class="ln-table__cell ln-table__select">
          <input type="checkbox" class="ln-choice__input">
        </td>
        <td class="ln-table__cell">
          <span class="d-flex align-items-center gap-2">
            <span class="ln-avatar ln-avatar--sm">CL</span>
            Carol Lee
          </span>
        </td>
        <td class="ln-table__cell">Manager</td>
        <td class="ln-table__cell">
          <span class="ln-badge ln-badge--success">Active</span>
        </td>
        <td class="ln-table__cell ln-table__cell--numeric">160</td>
      </tr>
      <tr class="ln-table__row">
        <td class="ln-table__cell ln-table__select">
          <input type="checkbox" class="ln-choice__input">
        </td>
        <td class="ln-table__cell">
          <span class="d-flex align-items-center gap-2">
            <span class="ln-avatar ln-avatar--sm">DK</span>
            David Kim
          </span>
        </td>
        <td class="ln-table__cell">Developer</td>
        <td class="ln-table__cell">
          <span class="ln-badge ln-badge--danger">Offline</span>
        </td>
        <td class="ln-table__cell ln-table__cell--numeric">72</td>
      </tr>
    </tbody>
    <tfoot>
      <tr>
        <td colspan="5">
          <div class="ln-table__foot">
            <span data-select-count>2 of 4 selected</span>
            <div class="ln-table__actions">
              <button class="ln-button ln-button--outline ln-button--sm" disabled>Previous</button>
              <span>Page 1 of 3</span>
              <button class="ln-button ln-button--outline ln-button--sm">Next</button>
            </div>
          </div>
        </td>
      </tr>
    </tfoot>
  </table>
</div>
RoleStatusHours
AJAlice JohnsonEngineerActive142
BSBob SmithDesignerAway98
CLCarol LeeManagerActive160
DKDavid KimDeveloperOffline72
2 of 4 selected
Page 1 of 3

Reference

ClassDescriptionResponsive
.ln-tableTable block containerNo
.ln-table__gridThe <table> elementNo
.ln-table__headerHeader cell (<th>)No
.ln-table__cellBody cell (<td>)No
.ln-table__rowBody row (<tr>)No
.ln-table__footFooter cell with pagination/selection countNo
.ln-table__selectCheckbox column cellNo
.ln-table__sortSortable header buttonNo
.ln-table--dividedRow dividers between cellsNo
.ln-table--stripedAlternating row backgroundsNo
.ln-table--borderedBorders on all cellsNo
.ln-table--compactReduced cell paddingNo
.ln-table--spaciousIncreased cell paddingNo
.ln-table--sticky-headerSticky column headersNo
.ln-table--sticky-firstSticky first columnNo
.ln-table--stackCard layout below md breakpointNo