HTML table 页脚在页眉之前
HTML table footer is coming before the header
我只是想在HTML中做一个简单的table,我知道tfoot元素应该在body之前渲染,所以你把它放在body和thead元素之间。
我试过将它放在 body 之前和之后,但我仍然得到下面的 table。
这是 table
的页脚
一个table
列表类型标签
有序列表
, -
无序列表
,-
术语和定义列表
、- 、
-
<head></head>
<body>
<table>
<caption>A table</caption>
<thead>
<tr>
<th>List Type</th>
<th>Tags</th>
</tr>
</thead>
<tbody><tr><td>Ordered List</td><td><ol>, <li></td></tr><tr><td>Unordered List</td><td><ul>, <li></td></tr>
<tr><td>Term and Definition list</td><td><dl>, <dt>, <dd></td> </tr>
<tfoot>
This is the footer of the table
</tfoot>
</tbody>
</table>
</body>
什么给了?
在页脚中使用 <tr>
和 <td>
标签
<tfoot>
<tr><td>This is the footer of the table</td></tr>
</tfoot>
你不应该把内容放在 <tfoot>
之后你需要添加 <tr>
和 <td>
我只是想在HTML中做一个简单的table,我知道tfoot元素应该在body之前渲染,所以你把它放在body和thead元素之间。 我试过将它放在 body 之前和之后,但我仍然得到下面的 table。
这是 table
的页脚一个table
列表类型标签
有序列表
- ,
-
无序列表
- ,
-
术语和定义列表
- 、
- 、
-
<head></head> <body> <table> <caption>A table</caption> <thead> <tr> <th>List Type</th> <th>Tags</th> </tr> </thead> <tbody><tr><td>Ordered List</td><td><ol>, <li></td></tr><tr><td>Unordered List</td><td><ul>, <li></td></tr> <tr><td>Term and Definition list</td><td><dl>, <dt>, <dd></td> </tr> <tfoot> This is the footer of the table </tfoot> </tbody> </table> </body>
什么给了?
-
在页脚中使用 <tr>
和 <td>
标签
<tfoot>
<tr><td>This is the footer of the table</td></tr>
</tfoot>
你不应该把内容放在 <tfoot>
之后你需要添加 <tr>
和 <td>