print page count with total number of pages using css

自作多情 提交于 2019-12-17 10:02:51

问题


I have a table which populated with dynamic data and to handle that in printing i have applied some page breaks to it everything works fine but i need to show a pagination like "Page 1 of 3" and so on below every page while printing. I have tried with css but i can only print the current page number with it. is there any other way of achieving it ?? here is my code

   body {
        counter-reset: page;
    }
    .page-count:after {
        counter-increment: page;
        content: "Page " counter(page) " of " counter(pages);
    }

回答1:


Did you try this:

@page {
   @bottom-right {
    content: counter(page) " of " counter(pages);
   }
}


来源:https://stackoverflow.com/questions/34654071/print-page-count-with-total-number-of-pages-using-css

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!