Skip to content
Introducing StyloftCSS 0.1 / A small foundation for your next big idea. Meet the framework
Data & feedback

Tables

Readable rows and columns, with captions, header relationships, and scrollable boundaries.

CSS only4 examplesKeyboard friendly HTML

A clear data table

Rows become labelled cards below 40rem, so every field stays visible without sideways scrolling. Entries are illustrative.

Live preview
Example project directory
ProjectCategoryStatusOwner
Studio notebookPortfolioReadyAlex
Field notesEditorialDraftSam
The component gardenDocumentationIn progressJordan
View HTML / PlaygroundHTML source
example.htmlHTML
<div
  class="sl-table-wrap"
  role="region"
  aria-labelledby="projects-caption"
  tabindex="0"
>
  <table class="sl-table sl-table--responsive" role="table">
    <caption id="projects-caption">
      Example project directory
    </caption>
    <thead role="rowgroup">
      <tr role="row">
        <th scope="col" role="columnheader">Project</th>
        <th scope="col" role="columnheader">Category</th>
        <th scope="col" role="columnheader">Status</th>
        <th scope="col" role="columnheader">Owner</th>
      </tr>
    </thead>
    <tbody role="rowgroup">
      <tr role="row">
        <th scope="row" role="rowheader">Studio notebook</th>
        <td role="cell">
          <span class="sl-table-label" aria-hidden="true">Category</span
          ><span>Portfolio</span>
        </td>
        <td role="cell">
          <span class="sl-table-label" aria-hidden="true">Status</span
          ><span><span class="sl-badge">Ready</span></span>
        </td>
        <td role="cell">
          <span class="sl-table-label" aria-hidden="true">Owner</span><span>Alex</span>
        </td>
      </tr>
      <tr role="row">
        <th scope="row" role="rowheader">Field notes</th>
        <td role="cell">
          <span class="sl-table-label" aria-hidden="true">Category</span
          ><span>Editorial</span>
        </td>
        <td role="cell">
          <span class="sl-table-label" aria-hidden="true">Status</span
          ><span><span class="sl-badge">Draft</span></span>
        </td>
        <td role="cell">
          <span class="sl-table-label" aria-hidden="true">Owner</span><span>Sam</span>
        </td>
      </tr>
      <tr role="row">
        <th scope="row" role="rowheader">The component garden</th>
        <td role="cell">
          <span class="sl-table-label" aria-hidden="true">Category</span
          ><span>Documentation</span>
        </td>
        <td role="cell">
          <span class="sl-table-label" aria-hidden="true">Status</span
          ><span><span class="sl-badge">In progress</span></span>
        </td>
        <td role="cell">
          <span class="sl-table-label" aria-hidden="true">Owner</span
          ><span>Jordan</span>
        </td>
      </tr>
    </tbody>
  </table>
</div>
HTML source · enable JavaScript for the playground65 lines · UTF-8

Module comparison

Live preview
Choose your building blocks
ModulePurposeRequired
CoreTokens, base, layouts, utilities, componentsYes
ProseLong-form text rhythmNo
TablesData table stylingNo
View HTML / PlaygroundHTML source
example.htmlHTML
<div class="sl-table-wrap" role="region" aria-labelledby="modules-caption" tabindex="0">
  <table class="sl-table sl-table--responsive" role="table">
    <caption id="modules-caption">
      Choose your building blocks
    </caption>
    <thead role="rowgroup">
      <tr role="row">
        <th scope="col" role="columnheader">Module</th>
        <th scope="col" role="columnheader">Purpose</th>
        <th scope="col" role="columnheader">Required</th>
      </tr>
    </thead>
    <tbody role="rowgroup">
      <tr role="row">
        <th scope="row" role="rowheader">Core</th>
        <td role="cell">
          <span class="sl-table-label" aria-hidden="true">Purpose</span
          ><span>Tokens, base, layouts, utilities, components</span>
        </td>
        <td role="cell">
          <span class="sl-table-label" aria-hidden="true">Required</span
          ><span>Yes</span>
        </td>
      </tr>
      <tr role="row">
        <th scope="row" role="rowheader">Prose</th>
        <td role="cell">
          <span class="sl-table-label" aria-hidden="true">Purpose</span
          ><span>Long-form text rhythm</span>
        </td>
        <td role="cell">
          <span class="sl-table-label" aria-hidden="true">Required</span><span>No</span>
        </td>
      </tr>
      <tr role="row">
        <th scope="row" role="rowheader">Tables</th>
        <td role="cell">
          <span class="sl-table-label" aria-hidden="true">Purpose</span
          ><span>Data table styling</span>
        </td>
        <td role="cell">
          <span class="sl-table-label" aria-hidden="true">Required</span><span>No</span>
        </td>
      </tr>
    </tbody>
  </table>
</div>
HTML source · enable JavaScript for the playground47 lines · UTF-8

Compact two-column data

Live preview
Source of truth
MetricWhere to find it
Core and modulesFramework size report
Website per-page CSSWebsite size report
View HTML / PlaygroundHTML source
example.htmlHTML
<div class="sl-table-wrap" role="region" aria-label="Framework sizes" tabindex="0">
  <table class="sl-table">
    <caption>
      Source of truth
    </caption>
    <thead>
      <tr>
        <th scope="col">Metric</th>
        <th scope="col">Where to find it</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <th scope="row">Core and modules</th>
        <td><a href="/downloads/size-report.json">Framework size report</a></td>
      </tr>
      <tr>
        <th scope="row">Website per-page CSS</th>
        <td><a href="/css-size-report.json">Website size report</a></td>
      </tr>
    </tbody>
  </table>
</div>
HTML source · enable JavaScript for the playground23 lines · UTF-8

Row emphasis on hover

The optional motion styles transition row backgrounds; native table semantics remain unchanged.

Live preview
Optional building blocks
ModuleIncludes
VariantsButton sizes and surfaces
MotionHover, reveal, split text
Responsive1200 / 1023 / 991 / 767px
View HTML / PlaygroundHTML source
example.htmlHTML
<div class="sl-table-wrap" role="region" aria-label="Example module list" tabindex="0">
  <table class="sl-table">
    <caption>
      Optional building blocks
    </caption>
    <thead>
      <tr>
        <th scope="col">Module</th>
        <th scope="col">Includes</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <th scope="row">Variants</th>
        <td>Button sizes and surfaces</td>
      </tr>
      <tr>
        <th scope="row">Motion</th>
        <td>Hover, reveal, split text</td>
      </tr>
      <tr>
        <th scope="row">Responsive</th>
        <td>1200 / 1023 / 991 / 767px</td>
      </tr>
    </tbody>
  </table>
</div>
HTML source · enable JavaScript for the playground27 lines · UTF-8

Classes beginning with sl- come from StyloftCSS. Examples with demo- classes also use our optional demo extension CSS ↓. Load it after the core to reproduce those details.