> For the complete documentation index, see [llms.txt](https://ajgallego.gitbook.io/bootstrap-4/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ajgallego.gitbook.io/bootstrap-4/componentes-responsive/tablas.md).

# Tablas

Bootstrap también define una serie de clases para aplicar estilos sobre las tablas de HTML. La más básica es la clase `.table`:

```markup
<table class="table">
  ...
</table>
```

La cual configura los estilos de las tablas básicas de HTML para que adopten el siguiente aspecto:

![](/files/-LwrBR-4NGGMSB-RV4Tk)

En la tabla anterior las celdas de la primera fila estarían marcadas con "th" y el resto de celdas con "td".

## Tablas pequeñas

Si queremos compactar el tamaño de la tabla para que deje un padding (o espaciado interior) inferior, podemos aplicar la clase `.table-sm` de la forma:

```markup
<table class="table table-sm">
    ...
</table>
```

Obteniendo:

![](/files/-LwrBR-6g8t4pebhgBUJ)

## **Colores alternos**

Si además aplicamos la clase `.table-striped` a nuestra tabla conseguiremos que las filas presenten colores alternos:

```markup
<table class="table table-striped">
  ...
</table>
```

Con lo que obtendríamos una tabla con el siguiente aspecto:

![](/files/-LwrBR-86ucezca99d74)

## **Tablas con bordes**

También podemos dibujar un borde al rededor de la tabla añadiendo la clase `.table-bordered`, de la forma:

```markup
<table class="table table-bordered">
  ...
</table>
```

Obteniendo el siguiente resultado:

![](/files/-LwrBR-A56QoYlYFZyMk)

## **Tablas&#x20;*****Responsive***

Bootstrap proporciona una forma de crear tablas *responsive* que se basa en crear un *scroll* horizontal para que se vean correctamente. Para que esto funcione simplemente tenemos que añadir la etiqueta `.table-responsive` a la propia tabla:

```markup
<table class="table table-responsive">
  ...
</table>
```

Obteniendo:

![](/files/-LwrBR-C4fCh4YcBMDei)

Este efecto se aplicará únicamente sobre dispositivos pequeños (`<576px`) mientras que en el resto de dispositivos no se notará la diferencia. Si queremos que el punto de ruptura a partir del cual se aplique el responsive sobre la tabla sea un tamaño mayor podemos indicar un sufijo de tamaño sobre esta etiqueta, de la forma `.table-responsive-*`, donde "`*`" podrá ser `sm`, `md`, `lg` o `xl`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ajgallego.gitbook.io/bootstrap-4/componentes-responsive/tablas.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
