分页符不中断 [英] Page break not breaking

查看:46
本文介绍了分页符不中断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用分页符,但它不起作用.我试图发布整个代码,但超过了字符数.我想知道是什么原因导致分页符无法正常工作.

I want to have page break but it is not working. I tried to post the whole code but it exceed number of characters. I wanted to know what may cause page break not to work.

@media print {
    div.pagebreak {
        display: block !important; 
        page-break-after: always; 
    }
    .dontprint{ 
        display : none
    }
    body{
        display: block;
    }

}

<tr ><td><div class="pagebreak"></div></td></tr>

推荐答案

我找到了答案

display: flex;
justify-content: center;
font-size: 10px;

当我删除它时,我将它作为样式添加到父div中.虽然我不知道为什么.我希望有人能回答为什么这种风格无法让分页符正常工作

I have this in my parent div as style when i remove it it works. Although i dont know why. I hope someone has the answer why this style is not letting the page break to work

这篇关于分页符不中断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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