开发者

Do invisible (display:none) cells count toward colspan

开发者 https://www.devze.com 2023-02-09 20:00 出处:网络
Just wondering.Also, is this applied equally across browsers? e.g.:开发者_运维技巧 <table><tr>

Just wondering. Also, is this applied equally across browsers?

e.g.:

开发者_运维技巧
<table><tr>
  <td>asdf</td>
  <td style="display:none;">asdf</td>
  <td>asdf</td>
</tr></table>

does colspan == 2 or 3?


It is colspan=2

td[colspan] {
  background-color: #ccc;
}
<table border=1>
  <tr>
    <td>TL</td>
    <td style="display:none;">HIDDEN</td>
    <td>TC</td>
    <td>TR</td>
  </tr>
  <tr>
    <td>ML</td>
    <td>MC</td>
    <td>MR</td>
  </tr>
  <tr>
    <td colspan="2">BL + BC</td>
    <td>BR</td>
  </tr>
</table>

You can see it with this example expanded

0

精彩评论

暂无评论...
验证码 换一张
取 消