Skip to content
0

Tables ​

Control table layout behavior and how table borders are rendered.

Table Layout ​

ClassProperties
.table-autotable-layout: auto
.table-fixedtable-layout: fixed

Border Collapse ​

ClassProperties
.border-collapseborder-collapse: collapse
.border-separateborder-collapse: separate

Basic Usage ​

html
<!-- Fixed-width table with collapsed borders -->
<table class="table-fixed border-collapse w-full">
  <thead>
    <tr>
      <th class="border border-neutral-300 p-2">Name</th>
      <th class="border border-neutral-300 p-2">Age</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td class="border border-neutral-300 p-2">Alice</td>
      <td class="border border-neutral-300 p-2">30</td>
    </tr>
  </tbody>
</table>

<!-- Auto-width table with separate borders -->
<table class="table-auto border-separate border-spacing-2">
  ...
</table>

TIP

Use .table-fixed for consistent column widths. Combined with .w-full, columns will be equally distributed regardless of content.

SCSS Source ​

scss
// From _utilities.scss
$table-layout-list: (auto, fixed) !default;
$border-collapse-list: (collapse, separate) !default;

Released under the MIT License.