{page-break-after: always} does not work when printing

EDIT: I noticed that this works in IE9, but not in IE10 and Chrome.

We receive emails formatted in HTML format from one of our suppliers electronically. Usually we print them before he places 1 PO on the page, but now he does not add page breaks. I checked the html and I don't understand why this will not work all of a sudden. This is (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> 

There may have been a page break here:

 <BR class=breakhere> 

This happens immediately after the TABLE element, TABLE has 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 this is code or something at our end? I tried every browser, several printers and workstations, but I can not get it to break pages.

Thanks!

+6
source share
2 answers

I did this too. It seems that using the page-break-after property in the interrupt string does not matter in IE10. According to the Internet Explorers documentation, which supports CSS 2.1 Section 13.3.1, the page-break-after property does not support line break or header elements. See Notes at this link: http://msdn.microsoft.com/en-us/library/ie/ms530842 . I had to switch my code to use the div with a break after the class, but this does not seem to work in IE9, which is awesome.

+7
source

a page break is not enough for an internet browser of your choice. If you try this, you will see the result. I have the same problem, but I solved it this way.

 <div style="page-break-after: always;"></div> <div>&nbsp; </div> 
+11
source

Source: https://habr.com/ru/post/946801/


All Articles