1. Tablas
  2. table-layout

Tablas

table-layout

Utilidades para controlar el algoritmo de diseño de tablas.

ClaseEstilos
table-auto
table-layout: auto;
table-fixed
table-layout: fixed;

Ejemplos

Tamaño de columnas automático

Usa la utilidad table-auto para ajustar automáticamente el tamaño de las columnas de la tabla al contenido de sus celdas:

CanciónArtistaAño
The Sliding Mr. Bones (Next Stop, Pottersville)Malcolm Lockyer1961
Witchy WomanThe Eagles1972
Shining StarEarth, Wind, and Fire1975
<table class="table-auto">  <thead>    <tr>      <th>Canción</th>      <th>Artista</th>      <th>Año</th>    </tr>  </thead>  <tbody>    <tr>      <td>The Sliding Mr. Bones (Next Stop, Pottersville)</td>      <td>Malcolm Lockyer</td>      <td>1961</td>    </tr>    <tr>      <td>Witchy Woman</td>      <td>The Eagles</td>      <td>1972</td>    </tr>    <tr>      <td>Shining Star</td>      <td>Earth, Wind, and Fire</td>      <td>1975</td>    </tr>  </tbody></table>

Uso de anchos de columna fijos

Usa la utilidad table-fixed para ignorar el contenido de las celdas de la tabla y usar anchos fijos para cada columna:

CanciónArtistaAño
The Sliding Mr. Bones (Next Stop, Pottersville)Malcolm Lockyer1961
Witchy WomanThe Eagles1972
Shining StarEarth, Wind, and Fire1975
<table class="table-fixed">  <thead>    <tr>      <th>Canción</th>      <th>Artista</th>      <th>Año</th>    </tr>  </thead>  <tbody>    <tr>      <td>The Sliding Mr. Bones (Next Stop, Pottersville)</td>      <td>Malcolm Lockyer</td>      <td>1961</td>    </tr>    <tr>      <td>Witchy Woman</td>      <td>The Eagles</td>      <td>1972</td>    </tr>    <tr>      <td>Shining Star</td>      <td>Earth, Wind, and Fire</td>      <td>1975</td>    </tr>  </tbody></table>

Puedes establecer manualmente los anchos de algunas columnas y el resto del ancho disponible se dividirá equitativamente entre las columnas sin un ancho explícito. Los anchos establecidos en la primera fila definirán el ancho de columna para toda la tabla.

Diseño responsivo

Antepone a la utilidad table-layout el prefijo de una variante de punto de ruptura como md: para aplicar la utilidad únicamente en tamaños de pantalla mediano y superiores:

<div class="table-auto md:table-fixed ...">  <!-- ... --></div>

Obtén más información sobre el uso de variantes en la documentación de variantes.

Copyright © 2026 Tailwind Labs Inc.·Política de marcas registradas