page-break-after does not work with the table tr in Chrome

259 Views Asked by At

I am generating a print report using table. The table has multiple rows; While Printing the page it requires a page-break-after each 15 rows

To do so, I have applied

@media print {
   tr:nth-of-type(15n){
    page-break-after: always !important;
    page-break-inside: avoid !important;
  }

What is the issue?

  • while applying the style page-break-after to a tr , page-break is not working see here

  • but when applying display:block to tr , it gives desired result but the layout of table is being distorted after changing tr display:table-row to display:block see here . I tried Firefox and it's ok there.

0

There are 0 best solutions below