打印时页面上的计数器

时间:2018-07-06 04:54:06

标签: css printing counter

我知道有一些关于此的主题,但我确实无法使其工作

我有使用IBM Domino(与xp:panels一起使用)生成代码的代码,并且在打印此文档时我需要在每个打印页面上显示页码。

这是我得到的

#pageFooter {
  display: table-footer-group;
}

#pageFooter::after {
  counter-increment: page;
  content: "Page " counter(page);
  right: 0;
  bottom: 100%;
  white-space: nowrap;
  z-index: 20px;
  -moz-border-radius: 5px;
  -moz-box-shadow: 0px 0px 4px #222;
  background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
  background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
}
<xp:panel style="width:800px;padding-left:35.0px" disableTheme="true">

  <tfoot class="report-footer">
    <tr class="footer">
      <td class="report-footer-cell">
        <div id="pageFooter"> PAGE # SHOULD BE HERE </div>
      </td>
    </tr>
  </tfoot>

  <tbody class="report-content">
    <tr>
      <td class="report-content-cell" colspan='2'>
        LOOONG LOOOONG LOOOONG CONTENT OF THE DOCUMENT
      </td>
    </tr>
  </tbody>

</xp:panel>

到目前为止,我得到的只是每页上的“第1页”,因此不会增加计数器

我已经尝试过使用@page@bottom-page在互联网上看到的所有内容,并将counter-increment移动到各处。

有什么帮助吗?

0 个答案:

没有答案