HTML-тег colgroup создаёт группу столбцов в таблице.
Элементы colgroup являются дочерними по отношению к элементам table и должны появляться только после элемента caption, если такой элемент используется.
Часто используется в сочетании с col.
Необязательные атрибуты
span
Атрибут: span.
Описание: количество столбцов, к которым применяется colgroup элемент.
Возможные значения: число.
Пример
<table>
<caption>Citrus</caption>
<colgroup span="2" class="columns1and2"></colgroup>
<tr>
<th>Lime</th>
<th>Lemon</th>
<th>Orange</th>
<th>Kumquat</th>
</tr>
<!-- etc. -->
</table>
<table>
<caption>Melon</caption
<colgroup>
<col class="column1">
<col span="3" class="columns2and3and4">
</colgroup>
<tr>
<th>Watermelon</th>
<th>Honeydew</th>
<th>Winter melon</th>
<th>Bitter melon</th>
</tr>
<!-- etc. -->
</table>Страницы в тему:
Все HTML-теги
a abbr address area article aside audio b base bdi bdo blockquote body br button canvas caption cite code col colgroup data datalist dd del dfn div dl dt em embed fieldset figcaption figure footer form h1 — h6 head header hr html i iframe img input ins kbd keygen label legend li link main map mark meta meter nav noscript object ol optgroup option output p param pre progress q rb rp rt rtc ruby s samp script section select small source span strong style sub sup table tbody td template textarea tfoot th thead time title tr track u ul var video wbr
Уроки:
- Таблицы: столбцы, верхние и нижние колонтитулы (Внушительный урок HTML)