Printing Issues

Hi everyone.

I'm having a little problem with a window.print()

In my page, I have a printer image with an on click proprety with "window.print()". Also, in my stylesheet, I have the @media print {display:none} style applied to everything in the page that i don't want to be seen on the printing. This all works fine.

My only problem is that i'm printing a couple of table records and, in the printing, they don't come out with the same aspect that they have on the page. Seems like the css for them is being ignored. I have already copied the css for the table records into the @media print{} section but to no good.

Any ideas?
Hi Carlos,

Without knowing the specific problems you're running into, the only questions I have to bring up are whether or not that behavior is browser specific or not - i.e. have you tried printing in a different browser?

That way you could better try to debug the behavior.

Could you post a screenshot of the screen, and attach a PDF printout of the page? The printing process sometimes doesn't mimic exactly what's on the screen, so without knowing the amount of differences it's hard for us to grasp what could be wrong.

Since most likely this is a CSS issue, I suggest also looking into Probably you've already been there, but if not it could give you some insights on it.


Paulo Tavares
In the bottom there's a screenshot of what i can get from the page into a single screenshot. And i attached the printed pdf file.

Also, just found that it's not a browser problem. Same thing happens in IE and Firefox.

So the main problem, as you can see in both the screenshot and the pdf, is the lack of frames on the table racords.

Any thoughts?

And thanks in advance guys :)

Hi Carlos.

After doing a bit of bug-tracking, research and the like, I found out that indeed, it is not a browser problem, but more of a browser settings option.

Read this:

Apparently it's widespread that browsers, by default, do not print background colors in tables.

In Firefox, you can change this behavior by clicking on File > Page Setup > Print Background (Colors and Images) .

In IE there should be a similar setting, and same for other browsers.

Hope this helps!


Paulo Tavares
Yeap, that does the trick ^^

Thanks a whole lot Paulo :D