我想知道是否有可能,当用户开始打印 html 页面时,防止在所有页面上打印表格的 thead
?
这是因为我在表格前面的元素上使用了 page-break-after: always;
,因此我的表格标题也打印在第一页上...
我无法用 tr
替换我的 thead
,因为我的代码的硬部分位于那个 thead
上。
最佳答案
使用 THEAD,您无法做到这一点。但是你可以尝试申请display: table-row
至 <thead>
但它不适用于所有浏览器
When long tables are printed, the head and foot information may be repeated on each page that contains table data (official docs)
关于html - 如何防止所有页面都打印thead,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40018225/