Print preview and print only prints a portion of my web page
Asked Answered
P

2

7

I have a rather large table data I need to print, but when I go to Print Preview or Print, I only see what's currently visible on the page, and not the entire content of the web page.

This happens in all browser. What could be causing this?

Philia answered 25/10, 2010 at 23:50 Comment(1)
This sounds strange. Any chance of a live link?Sunward
S
4

Strange, never heard of this happening. My speculation would be that you have some HTML construct in place like a container div with overflow: auto that makes the table actually span inside an element that is as tall as the viewport, instead of the whole page.

Sunward answered 26/10, 2010 at 0:10 Comment(5)
Wouldn't that give scrollbars on the table? The whole table is visible, but only some of it prints.Philia
@Stefan not necessarily, the scrollbars could be those of the div.Sunward
I've clicked through all the containers down to the bottom table, and Firebug lists the computed style as visible, not overflow.Philia
My search was not thorough. >_>Philia
Yes, it was. overflow: auto; had been added to fix some spacing issue (this was a bad fix), and it broke print-preview, which one of our users needed for business functionality :/.Philia
D
9

Oh my god, I spent so much time on it...

I wanted to use puppeteer to generate a pdf and I didn't understand why it only printed the first page in the output pdf.

Here was the reason: I had set properties overflow: auto and height: 100% on tag <body>. Once I've removed it, it worked fine.

I hope it can help someone.

Dollhouse answered 7/1, 2020 at 13:43 Comment(0)
S
4

Strange, never heard of this happening. My speculation would be that you have some HTML construct in place like a container div with overflow: auto that makes the table actually span inside an element that is as tall as the viewport, instead of the whole page.

Sunward answered 26/10, 2010 at 0:10 Comment(5)
Wouldn't that give scrollbars on the table? The whole table is visible, but only some of it prints.Philia
@Stefan not necessarily, the scrollbars could be those of the div.Sunward
I've clicked through all the containers down to the bottom table, and Firebug lists the computed style as visible, not overflow.Philia
My search was not thorough. >_>Philia
Yes, it was. overflow: auto; had been added to fix some spacing issue (this was a bad fix), and it broke print-preview, which one of our users needed for business functionality :/.Philia

© 2022 - 2024 — McMap. All rights reserved.