{page-break-after:always}在打印时不工作 [英] {page-break-after: always} not working when printing

查看:2308
本文介绍了{page-break-after:always}在打印时不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑:我只是注意到这在IE9,但不是IE10和Chrome。工作。

I just noticed this works in IE9, but not IE10 and Chrome.

我们从我们的供应商电子地收到HTML格式的PO报告。我们通常打印这些和之前它将为每页1 PO,但现在它不添加分页符。我检查了html,我不明白为什么它不会突然工作。这是(格式不正确)的html:

We receive HTML formatted PO reports from one of our suppliers electronically. We usually print these and before it would put 1 PO per page, but now it is not adding the page breaks. I checked the html and I can't see why it wouldn't work all of a sudden. This is the (poorly formatted) html:

<HEAD>
<STYLE TYPE='text/css'><!--
BR.breakhere {page-break-after: always}
.tb1{font:10pt Arial;}
.tb2{border-left:1px solid #000000; border-right:1px solid #000000;border-top: 1px  solid #000000;border-bottom: 1px solid #000000;}
.tb3{font:10pt Arial;border-left:1px solid #000000; border-right:1px solid #000000;border-top: 1px  solid #000000;border-bottom: 1px solid #000000;}
.tb4{font-size:8pt;}
--></STYLE>
</HEAD>

分页符假设发生在这里:

The page break is suppose to occur here:

<BR class=breakhere>

它在TABLE元素之后立即出现,TABLE在最后一个TR(ugh)之后有一个HR。

It occurs immediately after a TABLE element, the TABLE has an HR after the last TR (ugh).

<BR><HR style = "width:100%;height:10px;color:#000000"></TABLE><BR class=breakhere>

我想联系他们并提及这一点,但我不知道它是否是代码或东西在我们的结束?我尝试了每个浏览器,多个打印机和工作站,但不能让它打破页面。

I want to contact them and mention this but I'm not sure if it is the code or something on our end? I've tried every browser, multiple printers and workstations, but can't get it to break pages.

谢谢!

推荐答案

我一直在处理这个。看起来在IE10中使用break-line中的page-break-after属性是no-no。根据Internet Explorer当前支持CSS 2.1第13.3.1节的文档,page-break-after属性不支持换行符或标题元素。请参阅此链接中的备注: http://msdn.microsoft.com/en-us/library/ie / ms530842 。我不得不切换我的代码使用一个div后的类,但这似乎不工作在IE9这是真棒。

I've been dealing with this too. It appears that using the page-break-after property in a break line is a no-no in IE10. According to Internet Explorer’s current documentation supporting CSS 2.1 Section 13.3.1, the page-break-after property does not support line break or header elements. See the remarks in this link: http://msdn.microsoft.com/en-us/library/ie/ms530842. I had to switch my code to use a div with the break after class but that doesn't seem to work in IE9 which is awesome.

这篇关于{page-break-after:always}在打印时不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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