【发布时间】:2017-07-29 04:49:59
【问题描述】:
我有一个具有以下结构的 html 表:
<table>
<thead>
<tr><th>ABC Ltd.</th><tr>
</thead>
<tbody>
<table>
<thead><tr><th>Name</th></tr></thead>
<tbody>
<tr><td>ola</td></tr>
<tr><td>ola</td></tr>
<tr><td>ola</td></tr>
<tr><td>ola</td></tr>
... 500 more rows ...
</tbody>
</table>
</tbody>
</table>
我必须确保 ABC Ltd. 和 Name 出现在每一页上。我该怎么做?
我尝试使用:
@media print
{
thead { display:table-header-group }
tfoot { display:table-footer-group }
}
【问题讨论】:
-
上面的示例代码应该可以在 Internet Explorer 和 Firefox 中运行。对于 Chrome 和 Safari,请参阅我的解决方案 here。我还没有找到适用于 Opera 的解决方案。
标签: html printing html-table nested