<colgroup> and <col> should be used, and if so, why and how?

I am trying to use colgroup and col tags correctly, but I do not understand. I read the specification and all that, but I don’t understand its purpose or how to implement it.

Any tips?

+4
source share
2 answers

A is colgroupused in an element tableto help understand the complex hierarchy of information in tables with irregular headers.

WAI has a complete information page on how to deal with this situation: Tables with incorrect headers and understand usage colandcolgroup

, . <col> , . , <colgroup> <col>, , , span.

, style class:

<table>
  <colgroup>
    <col style="background-color:red">
    <col style="background-color:yellow">
    <col style="background-color:blue">
  </colgroup>
  <tr>
    <th>First</th>
    <th>Second</th>
    <th>Third</th>
  </tr>
  <tr>
    <td>1</td>
    <td>2</td>
    <td>3</td>
  </tr>
</table>
+6

colgroup col: .

4 , , , , .. , WWW , , HTML5 . , , , colgroup col. , , ? ? ? , ?

, , , , . , , , - . , , , . , , .

colgroup - , col - . W3C col colgroup, col colgroup, colgroup can not span = "", col .

1 - colgroup col.

<col>
<colgroup span="2"></colgroup>
<colgroup>
<col span="3">
</colgroup>

2 - colgroup col.

<col>
<colgroup span="2"><colgroup>
<colgroup span="2">
<col span="3">
</colgroup>

2 ​​ 2 , col, , UA , 3 2. ? , , , , , , " 508", " ", 1998 , 508 , , . , , / , , -, - , ... , . , -, W3C :

. , .

, , , :

. , -, , , , (SEO). , - , , . - - , , .

w3.org :

colgroup col , ( , , -, , , , - ), , . , , , ( -, ). , -, .

+1

Source: https://habr.com/ru/post/1668130/


All Articles