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

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

问题描述

我有一个表格,其中填充了动态数据并在打印时处理它打印时每页下方等等.我尝试过使用 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);
    }

推荐答案

您是否尝试过:

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

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

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