AdNow

loading...

Etiqueta HTML col

Etiqueta HTML <col>


Ejemplo

Establezca el color de fondo de las tres columnas con las etiquetas <colgroup> y <col>:
<table>
  <colgroup>
    <col span="2" style="background-color:red">
    <col style="background-color:yellow">
  </colgroup>
  <tr>
    <th>ISBN</th>
    <th>Title</th>
    <th>Price</th>
  </tr>
  <tr>
    <td>3476896</td>
    <td>My first HTML</td>
    <td>$53</td>
  </tr>
</table>
Inténtalo tú mismo "

Definición y uso

La etiqueta <col> especifica las propiedades de columna para cada columna dentro de un elemento <colgroup> .
La etiqueta <col> es útil para aplicar estilos a columnas completas, en lugar de repetir los estilos para cada celda, para cada fila.

Soporte del navegador

Element
<col>YesYesYesYesYes

Diferencias entre HTML 4.01 y HTML5

La mayoría de los atributos en HTML 4.01 no son compatibles con HTML5.

En HTML, la etiqueta <col> no tiene etiqueta final.
En XHTML, la etiqueta <col> debe estar correctamente cerrada.

Atributos

AttributeValueDescription
alignleft
right
center
justify
char
Not supported in HTML5.
Specifies the alignment of the content related to a <col> element
charcharacterNot supported in HTML5.
Specifies the alignment of the content related to a <col> element to a character
charoffnumberNot supported in HTML5.
Specifies the number of characters the content will be aligned from the character specified by the char attribute
spannumberSpecifies the number of columns a <col> element should span
valigntop
middle
bottom
baseline
Not supported in HTML5.
Specifies the vertical alignment of the content related to a <col> element
width%
pixels
relative_length
Not supported in HTML5.
Specifies the width of a <col> element

Atributos globales

La etiqueta <col> también admite los atributos globales en HTML .

Atributos del evento

La etiqueta <col> también admite los atributos de evento en HTML .

páginas relacionadas

Referencia de HTML DOM: Objeto de columna

Configuración CSS predeterminada

La mayoría de los navegadores mostrarán el elemento <col> con los siguientes valores predeterminados:

Ejemplo

col { 
    display: table-column;
}
Inténtalo tú mismo "


Formulario de contacto

Nombre

Correo electrónico *

Mensaje *

Entradas más populares de este blog

Listado pasaporte y cedulas SAIME 2018

Etiqueta HTML < abbr >

HTML < a > tag

Visitas a este blog