I'm using Confluence 5.10.8 and when I use pdf export to export a page containing a table, the export works except it does not retain the cell background colors I had applied in the table. Is there a way to retain these colors?
I tested on Confluence 5.10.8 and the cell colors were in the PDF export. Are you using the native Confluence tools (they are Space Tools>Content Tools>Export and the ... menu>export to PDF)?
There are a lot of pouplar add-ons for exporting to PDF, I wonder if you are using one of them?
I have this issue still in the latest version of Confluence Cloud. Table background colours do not persist no matter what the format of the export is: Word, PDF or HTML.
For the HTML part, I discovered what I believe is the problem. The table styles are being written inline instead of in the site.css style sheet. For whatever reason, my browser doesn't pick up the colours inline, but it does pick them up if they're in the site.css style sheet. I manually worked around this by adding the styles myself to the CSS stylesheet, but it took hours to figure out. And not everyone will be able to do it.
So I recommend that Atlassian changes the way table colours are rendered. Don't use inline HTML attributes! Instead, create a new class for each colour, add the class to the HTML element instead of the colour attribute, and then do the styling on the class.
For anyone interested, the workaround is as follows. You have to repeat it for each colour... but with some regex magic I'm sure you could make it work for multiple colours:
In a nutshell, you are moving inline HTML attributes away from the HTML document and replacing them with CSS styles that are applied via classes. For the advanced user with lots of styles to worry about, you could use Notepad++'s regex feature and use a group to capture the background colour and then create a class based on the background colour where the class name was somehow derived from the background colour... And then you could probably automate a lot of this.
Or maybe there are tools that allow you to run HTML through them and they spit out CSS in place of the inline attributes...
- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events