打印页面数与使用css的页面总数 [英] print page count with total number of pages using css

查看:144
本文介绍了打印页面数与使用css的页面总数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表填充动态数据,并处理在打印我已应用一些分页符,一切正常,但我需要显示一个分页,例如第1页,共3页并在打印时在每页下面。我试过css,但我只能打印当前页码。有没有其他方法实现呢?
这里是我的代码

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);
    }


推荐答案

/ p>

Did you try this:

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

这篇关于打印页面数与使用css的页面总数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆