Question

What I am trying to do is change the background colour of a table cell <td> and then when a user goes to print the page, the changes are now showing.

I am currently using an unobtrusive script to run the following command on a range of cells:

element.style.backgroundColor = "#f00"

This works on screen in IE and FF, however, when you go to Print Preview, the background colours are lost.

Am I doing something wrong?

Was it helpful?

Solution

Have you tried hard-coding the values just to see if background-colors are showing on the print-preview at all? I think it is a setting in the Browser.

OTHER TIPS

Is it not recommended to do this with stylesheets? You can change the media type in the LINK statement in your HTML, so when the page is printed, it will revert to the different style?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top