代码之家  ›  专栏  ›  技术社区  ›  Grapho

HTML表语义:<thead>带有多个<tr>

  •  1
  • Grapho  · 技术社区  · 11 年前

    如果我定义了 <thead> 这样地:

    <thead>
      <tr>
        <th colspan=3>Category 1</th>
        <th colspan=2>Category 2</th>
      </tr>
      <tr>
        <th>Sub-cat 1</th>
        <th>Sub-cat 2</th>
        <th>Sub-cat 3</th>
        <th>Sub-cat 4</th>
        <th>Sub-cat 5</th>
      </tr>
    </thead>
    

    该结构是否在语义上正确地划分了类别/子类别?

    我知道从视觉上看它会很好,但我不确定这对于屏幕阅读器或W3C规范来说会是什么样子。

    1 回复  |  直到 11 年前
        1
  •  -4
  •   Imran    11 年前

    浏览器可以使用 thead , tbody , tfooter 以实现独立于页眉和页脚的表体滚动。当打印跨越多页的大表格时, 席德牌手表 , 表格主体 , tfooter公司 元素可以使页眉和页脚打印在每页的顶部和底部。有关详细信息,请参阅以下内容: http://www.w3schools.com/tags/tag_thead.asp