Why is styling table columns not allowed?

后端 未结 4 1812
太阳男子
太阳男子 2020-12-06 04:59

W3 specifies that only four CSS rules are allowed for table columns (with the element) - border, background, width and visibility.

Does anyo

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-06 05:54

    Just a wild stab in the dark based upon my limited understanding:

    I think styling via column related elements is restricted because although and represent columns of cells, it does not actually contain them (they're actually contained by the s). With this comes issues of precedence and specificity and cascading (since cascading can only be done between contained/ container elements) - when conflicting style rules from the and (which would be the same level in a multiple inheritance hierarchy) occur - which should the cell actually use?

    As to why that particular handful of style attributes is permitted though: no idea.

提交回复
热议问题