Repo
NameStatusRole
Alice JohnsonActiveDesigner
Bob SmithAwayEngineer
Carol DavisActiveProduct Manager
<table class="zui-table">
<thead class="zui-table-header">
  <tr class="zui-table-row">
    <th class="zui-table-head">Name</th>
    <th class="zui-table-head">Status</th>
    <th class="zui-table-head">Role</th>
  </tr>
</thead>
<tbody class="zui-table-body">
  <tr class="zui-table-row">
    <td class="zui-table-cell">Alice Johnson</td>
    <td class="zui-table-cell">Active</td>
    <td class="zui-table-cell">Designer</td>
  </tr>
  <tr class="zui-table-row">
    <td class="zui-table-cell">Bob Smith</td>
    <td class="zui-table-cell">Away</td>
    <td class="zui-table-cell">Engineer</td>
  </tr>
  <tr class="zui-table-row">
    <td class="zui-table-cell">Carol Davis</td>
    <td class="zui-table-cell">Active</td>
    <td class="zui-table-cell">Product Manager</td>
  </tr>
</tbody>
</table>

With Caption

Team members and their current status.
NameStatusRole
Alice JohnsonActiveDesigner
Bob SmithAwayEngineer
Carol DavisActiveProduct Manager
<table class="zui-table">
<caption class="zui-table-caption">Team members and their current status.</caption>
<thead class="zui-table-header">
  <tr class="zui-table-row">
    <th class="zui-table-head">Name</th>
    <th class="zui-table-head">Status</th>
    <th class="zui-table-head">Role</th>
  </tr>
</thead>
<tbody class="zui-table-body">
  <tr class="zui-table-row">
    <td class="zui-table-cell">Alice Johnson</td>
    <td class="zui-table-cell">Active</td>
    <td class="zui-table-cell">Designer</td>
  </tr>
  <tr class="zui-table-row">
    <td class="zui-table-cell">Bob Smith</td>
    <td class="zui-table-cell">Away</td>
    <td class="zui-table-cell">Engineer</td>
  </tr>
  <tr class="zui-table-row">
    <td class="zui-table-cell">Carol Davis</td>
    <td class="zui-table-cell">Active</td>
    <td class="zui-table-cell">Product Manager</td>
  </tr>
</tbody>
</table>
NameStatusRole
Alice JohnsonActiveDesigner
Bob SmithAwayEngineer
Carol DavisActiveProduct Manager
Total members3
<table class="zui-table">
<thead class="zui-table-header">
  <tr class="zui-table-row">
    <th class="zui-table-head">Name</th>
    <th class="zui-table-head">Status</th>
    <th class="zui-table-head">Role</th>
  </tr>
</thead>
<tbody class="zui-table-body">
  <tr class="zui-table-row">
    <td class="zui-table-cell">Alice Johnson</td>
    <td class="zui-table-cell">Active</td>
    <td class="zui-table-cell">Designer</td>
  </tr>
  <tr class="zui-table-row">
    <td class="zui-table-cell">Bob Smith</td>
    <td class="zui-table-cell">Away</td>
    <td class="zui-table-cell">Engineer</td>
  </tr>
  <tr class="zui-table-row">
    <td class="zui-table-cell">Carol Davis</td>
    <td class="zui-table-cell">Active</td>
    <td class="zui-table-cell">Product Manager</td>
  </tr>
</tbody>
<tfoot class="zui-table-footer">
  <tr class="zui-table-row">
    <td class="zui-table-cell" colspan="2">Total members</td>
    <td class="zui-table-cell">3</td>
  </tr>
</tfoot>
</table>

CSS custom properties

Set these on :root, on a wrapper, or on the element. See Component custom properties.

Property Default Description
--zui-table-border oklch(from currentColor l c h / 15%) Row, header and footer border colour
--zui-table-cell-padding var(--space-2xs) Cell padding
--zui-table-hover-bg oklch(from currentColor l c h / 10%) Row background on hover
--zui-table-selected-bg oklch(from currentColor l c h / 25%) Background of a row with data-state="selected"

Theme

Copy this CSS to your project: