如何应用 CSS 分页符来打印包含大量行的表格? [英] How to apply CSS page-break to print a table with lots of rows?
本文介绍了如何应用 CSS 分页符来打印包含大量行的表格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的网页中有一个动态表格,有时会包含很多行.我知道有 page-break-before
和 page-break-after
CSS 属性.如果需要,我应该将它们放在我的代码中的什么位置以强制分页?
I have a dynamic table in my web page that sometimes contains lots of rows. I know there are page-break-before
and page-break-after
CSS properties.
Where do I put them in my code in order to force page breaking if needed?
推荐答案
您可以使用以下内容:
<style type="text/css">
table { page-break-inside:auto }
tr { page-break-inside:avoid; page-break-after:auto }
</style>
有关详细信息,请参阅 W3C 的CSS 打印配置文件规范.
Refer the W3C's CSS Print Profile specification for details.
还可以参考 Salesforce 开发者论坛.
这篇关于如何应用 CSS 分页符来打印包含大量行的表格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文