PDF分页符和添加页脚行

时间:2019-04-20 05:44:44

标签: html css pdf

我需要避免PDF中的表格中断 还需要显示页脚线。 请参见下面的代码

<style type="text/css" media="print">
  @page {
    margin-left: 1cm;
    margin-right: 1cm;
    margin-top: 0.8cm;
    margin-bottom: 2cm;
    @bottom-center {
      content: element(footer);
    }
    @top-center {
      content: element(header);
    }
  }

  table {
    page-break-inside: avoid;
  }

  div.footer {
    page-break-after: avoid;
    display: block;
    position: running(footer);
    font-size: 12px;
    font-family: " sans-serif";
  }

  div.header {
    display: block;
    position: running(header);
  }
</style>

如果我在样式表的表格中添加-fs-table-paginate: paginate;,则除第一页外的所有页面的页脚行都会消失。

0 个答案:

没有答案
相关问题