首页 > Web开发 > 详细

批量打印 | 多页打印 | PHP多页打印

时间:2021-01-03 15:27:33      阅读:84      评论:0      收藏:0      [点我收藏+]

一直以为很难,一定需要插件什么的。或者要精通JS

看到一篇文章发现就在div加上一行属性就行了...

发布记录一下,很久以前就想要实现的功能了。

 

上代码:

<script>
    window.print(); //默认自动弹出打印框
</script>
<DIV STYLE="page-break-before:always">
    <table width="300px" height="100px" border=1>
        <th>列1</th>
        <th>列2</th>
        <tr>
            <td>数据1</td>
            <td>数据2</td>
        </tr>
    </table>
    <br />
</DIV>
<!-- 下面是重复数据 -->
<DIV STYLE="page-break-before:always">
    <table width="300px" height="100px" border=1>
        <th>列1</th>
        <th>列2</th>
        <tr>
            <td>数据1</td>
            <td>数据2</td>
        </tr>
    </table>
    <br />
</DIV>

实际效果

技术分享图片

 

批量打印 | 多页打印 | PHP多页打印

原文:https://www.cnblogs.com/insane/p/14225447.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!