Get to know MDN better
Esta página ha sido traducida del inglés por la comunidad. Aprende más y únete a la comunidad de MDN Web Docs.
This feature is well established and works across many devices and browser versions. It’s been available across browsers since julio de 2015.
* Some parts of this feature may have varying levels of support.
El elemento HTML <th> define una celda como encabezado de un grupo de celdas en una tabla. La naturaleza exacta de este grupo está definida por los atributos scope y headers.
| Ninguno |
|
Contenido de flujo, pero sin encabezado, pie de página, contenido de
seccionamiento, o contenido descendiente de encabezados
|
|
La etiqueta de inicio es obligatoria. La etiqueta de cierre puede ser omitida si es inmediatamente seguida por el elemento <th> o <td> o si no hay más datos en su elemento padre. |
| Un elemento <tr> |
| Cualquiera |
| HTMLTableHeaderCellElement |
Este elemento incluye los atributos globales.
abbr in HTML5Este atributo contiene una breve descripción del contenido de las celdas. Algunos agentes de usuario (e.g., a speech reader) pueden presentar esta descripción antes que el propio contenido.
Nota: No uses este atributo, ya que se ha vuelto obsoleto en el último estandar. Alternativamente, puedes poner la descripción abreviada dentro de la celda y colocarla el largo contenido en el atributo de title.
Este atributo enumerado especifica cómo se tratará el alineado horizontal de la celda. Los valores posibles son:
El valor por defecto cuando no se especifica este atributo es left.
Nota: No usar este atributo, ya que está obsoleto en el último estándar.
Este atributo contiene una lista de cadenas separadas por espacios. Cada cadena es el id de un grupo de celdas a las que se les aplica esta cabecera.
Nota: Este atributo está obsoleto en el último estándar y no debe usarse. Puedes sustituirlo por scope.
Este atributo define el color de fondo de cada celda en una columna. Consiste en una código hexadecimal de 6 digitos, con un prefijo '#'. Este atributo puede usarse con uno de los 16 colores predefinidos:
| silver = "#C0C0C0" | lime = "#00FF00" | ||
| gray = "#808080" | olive = "#808000" | ||
| white = "#FFFFFF" | yellow = "#FFFF00" | ||
| maroon = "#800000" | navy = "#000080" | ||
| red = "#FF0000" | blue = "#0000FF" | ||
| purple = "#800080" | teal = "#008080" | ||
| fuchsia = "#FF00FF" | aqua = "#00FFFF" |
Nota: No usar este atributo, ya que no es un estándar y sólo esta implementado en algunas versiones de Microsoft Internet Explorer. El elemento <th> debe estilizarse usando CSS. Para crear un efecto similar usa la propiedad background-color.
El contenido de la celda se alinea con un caracter en el elemento <th>. Los valores típicos incluyen un punto (.) para alinear números o valores monetarios. Si no se establece align como char, el atributo es ignorado.
Nota: No usar este atributo, ya que no está soportado por el último estándar. Para lograr el mismo efecto, puedes especificar el caracter como el primer valor de la propiedad text-align.
This attribute is used to shift column data to the right of the character specified by the char attribute. Its value specifies the length of this shift.
Nota: No usar este atributo, ya que no está soportado por el último estándar.
This attribute contains a positive integer value that indicates over how many columns a cell is extended. Its default value is 1. If its value is set to 0, the cell is extended to the last element of the <colgroup>. Values higher than 1000 are clipped down to 1000.
headersThis attribute contains a list of space-separated strings, each corresponding to the id attributes of other <th> elements that relate to this element.
rowspanThis attribute contains a positive integer value that indicates over how many rows a cells is extended. Its default value is 1. If its value is set to 0, the cell is extended to the last element of the table sections (<thead>, <tbody> or <tfoot>). Values higher than 65534 are clipped down to 65534.
scopeThis enumerated attribute defines the cells that the header (defined in the <th>) element relates to. It may have the following values:
This attribute specifies how a text is vertically aligned inside a cell. Possible values for this attribute are:
Nota: Do not use this attribute as it is no longer supported by the latest standard: use the CSS vertical-align property instead.
This attribute is used to define a recommended cell width. Additional space can be added with the cellspacing and cellpadding properties and the width of the <col> element can also create extra width. But, if a column's width is too narrow to show a particular cell properly, it will be widened when displayed.
Nota: Do not use this attribute in the latest standard: use the CSS width property instead.
See <table> for examples on <th>.
| HTML # the-th-element |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 29 abr 2026 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.