【问题标题】:HTML Table Query on thead and tfoot在 thead 和 tfoot 上的 HTML 表查询
【发布时间】:2015-08-03 13:52:54
【问题描述】:

当我们在一个表格中拥有多个 thead 和 tfoot 标签时会发生什么?浏览器如何响应它?

【问题讨论】:

  • 你为什么要问这个问题?如果你真的需要测试,试试Browser Shots。
  • 为什么不测试一下,先生自己看看?

标签: html


【解决方案1】:

它只是在现有表格中添加另一个页眉和页脚。

你在这里查看https://jsfiddle.net/no220phd/3/

<table style="width:100%">
<thead>
<tr>
<th>head1 col1</th>
<th>head1 col2</th>
<th>head1 col3</th>
</tr>
</thead>
<thead>
<tr>
<th>head2 col1</th>
<th>head2 col2</th>
<th>head2 col3</th>
</tr>
</thead>
  <tr>
    <td>Jill</td>
    <td>Smith</td>      
    <td>50</td>
  </tr>
  <tr>
    <td>Eve</td>
    <td>Jackson</td>        
    <td>94</td>
  </tr>
  <tr>
    <td>John</td>
    <td>Doe</td>        
    <td>80</td>
  </tr>
    <tfoot>
    <th>foot1 col1</th>
<th>foot1 col2</th>
<th>foot1 col3</th>
    </tfoot>
    <tfoot>
    <th>foot2 col1</th>
<th>foot2 col2</th>
<th>foot2 col3</th>
    </tfoot>
</table>

【讨论】:

  • 但是如果你把 tfoot 放在 tbody 之前,检查会发生什么?我需要那个场合的定义吗?
  • 如果您在 tbody 之前放置 2 个 tfoot,那么它将只显示第 1 个 tfoot 而不是第 2 个。
  • 所以其他脚标签通常作为一行添加到它所在的位置
猜你喜欢
  • 2019-04-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-12-02
  • 2012-07-16
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多