Please explain rowspan and colspan, col and colgroup

后端 未结 3 1822
忘了有多久
忘了有多久 2021-02-13 18:36

Can anyone explain rowspan and colspan, col and colgroup? And are these W3C valid and semantically correct? Under which circu

3条回答
  •  盖世英雄少女心
    2021-02-13 19:15

    colspan

    people are...
    monkeys donkeys

    rowspan

    monkeys are... ... real monkeys
    ... 'unreal' monkeys (people...)

    w3c

    as you see, this is for connecting table-cells - and because this is sometimes neccessary, it's valid (RegDwights links will give more information...).

    col/colgroup

    colgroup and col are used to set attributes to every line in the table (so you don't have to write width="80" for the first td in every line(tr)):

    first line, first column first line, second column first line, third column

    you can also group the cols, lets say the first and second column should get a with of 80, the third should get 320:

    first line, first column first line, second column first line, third column

提交回复
热议问题