css在打印页面上插入页码

时间:2016-06-30 00:33:11

标签: javascript html css printing

目前我使用<thead><tbody>打印页面,因为它会显示在每个页面上。我想插入一个页码,如“Page 1/2”。在我用Google搜索并查找stackoverflow之后,解决方案css已经无法用于当前的浏览器。像这样的代码

@page {
    counter-increment: page;
    counter-reset: page 1;
    @top-right {
        content: "Page " counter(page) " of " counter(pages);
    }
}

所以我正在寻找将打印页码插入打印页面的最新解决方案。希望你的所有人都能分享你的方法,无论是在css,javascript,jquery还是html。谢谢! PS:请不要告诉我使用打印对话框设置来显示页码

参考: print page count with total number of pages using css

IE and Edge: Print page numbers on pages when printing html

Add Page number using Page Property of CSS for each printed pages from asp.net c#

Page numbers with CSS/HTML

Browser Support for CSS Page Numbers

0 个答案:

没有答案