B Best
B Best

Reputation: 1166

IE11 Blank page preceding print screen

I am currently trying to print a page on IE11, however when the Print Preview is shown there is always a blank page as the first page. This is in my css code below. This first blank page doesn't show up in the Chrome print preview however.

@media print {
    html, body {
        height: 99%;
     }
    #noprint{
     display: none !important;
      visibility: hidden;
    }
    .page-break
    {
           page-break-after: always;
      }
      .last-page{
            page-break-after: avoid;
      }
}

Upvotes: 2

Views: 1064

Answers (2)

Vasily Ivanov
Vasily Ivanov

Reputation: 380

I had the same problem. It appears that the tr element automatically has page-break-inside: avoid. So, I added

  tr {
    page-break-inside: auto;
  }

and it helped.

Upvotes: 1

d.i.joe
d.i.joe

Reputation: 719

I encountered the same issue in both Edge and IE whenever I put page-break-after: always on the divs involved. Had a hard time investigating until recently, I decided to review the rendered HTML tag by tag.

The issue was fixed by replacing the display: flex into display: block on all parent div tags.

Upvotes: 0

Related Questions