You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Online

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

#111428 table background colors not printing

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by Pappy on Thursday, 14 July 2022 16:18 BST

Pappy
We are using tables with alternate background colors in an article.

When viewing from the front, if I click Print a page opens with the article formatted correctly.

When I print it, the background colors are removed.

If I Export the page as a PDF, then print, it retains the background colors.

This was working before.

Any ideas?

Thanks,
Mark

Ryan
If the table is displaying correctly in the front-end and in the print preview, then the final print output is determined by the printer driver. You may be able to toggle a setting when printing to print background colours.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

Pappy
Clicking: File > Print

The Print preview (on Apple/Mac) does not show the formatting. See attached.

Attachments

Ryan
This is determined by the browser and system printer driver, and there appears to be very little one can do to fix or override this. You can try adding the following to you template stylesheet, but I can't guarantee it will work (reference - https://developer.mozilla.org/en-US/docs/Web/CSS/print-color-adjust):

@media print {
    table tr {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

Pappy
Appreciate you finding that, but it did not work.

It is odd when I print a page, that it displays the web page menu bar (background) and it can toggle on/off with printer setting.
But it does not affect table/cell backgrounds.

Thought for sure media print would work as it is focused on the table elements.


Not sure what is triggered or not, but if I open an article to edit and only click the "Print" button in the JCE toolbar, the print/popup shows the table background colors. No prompt from web browser.

If I try it twice, the web browser asks "this website is wanting to print this page...." then it will not work.

The only way I've found that works using Safari. Page I want to print is open, go to File > Export as PDF > then Print

It retains background colors.