HTML <col> span Atribut

❮ HTML tag <col>

Příklad

Zde by první dva sloupce měly mít barvu pozadí červenou:

<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>

Definice a použití

Atribut spandefinuje počet sloupců, které <col>by měl prvek zahrnovat.


Podpora prohlížeče

Attribute
span Yes Yes Yes Yes Yes

Syntax

<col span="number">

Hodnoty atributů

Value Description
number Sets the number of columns a <col> element should span

❮ HTML tag <col>