table-layout

Class Description

table-auto

Sets table-layout: auto. Table adapts column widths to content.

CSS Rules

.table-auto {
  table-layout: auto;
}

Usage

<element class="table-auto" />

Responsive

Prefix .table-auto utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:table-auto" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="table-auto:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="table-auto:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before table-auto::before" />

<element class="content-after table-auto::after" />
.table-auto Sets table-layout: auto. Table adapts column widths to content.

table-fixed

Sets table-layout: fixed. Table respects explicit column widths.

CSS Rules

.table-fixed {
  table-layout: fixed;
}

Usage

<element class="table-fixed" />

Responsive

Prefix .table-fixed utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:table-fixed" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="table-fixed:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="table-fixed:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before table-fixed::before" />

<element class="content-after table-fixed::after" />
.table-fixed Sets table-layout: fixed. Table respects explicit column widths.