page break css after every second <tr> not working in google chrome

5.2k Views Asked by At

i have dynamic items in tr , try to pint two tr per page and my css is

CSS :

 @media print {
      body {font-size:10px}
       table tr:nth-child(2n) {
        page-break-after: always;
        }
        .noptrint {display:none;}
      }  

and see http://jsfiddle.net/4jr8s/

it work on firefox but not in Chrome browser, what is problem in chrome ?

2

There are 2 best solutions below

1
On BEST ANSWER

How to achieve page break in HTML table for Google Chrome?

Finally i resolved this issue. I madetr{display:block;} and then i fixed the the cell spacing. page break only works on block level elements. @sarsarahman

0
On

You have to make all <tr> as {display: block} and then where you want page break, you can do {page-break-after: always}.