Native Confluence features allow you to customize your table. But if you want to achieve something similar to MS Excel conditional formatting, you can use the Table Transformer macro from the Table Filter and Charts for Confluence app. Let's have a look at how you can achieve it.
The Table Transformer macro allows you to alter your table however you like with the help of SQL queries. It means that the possibilities are nearly endless.
In this example, we have a table that a marketing team can create to see how much profit consultations, webinars, guides, and brochures brought to a company over each quarter. Conditional formatting can come in handy if you want to highlight the months, depending on whether you achieved the sales goal.
Let's start with a simple one-column table and break down quarterly profits coming from selling consultations.
SELECT
T1.'Quarter',
FORMATWIKI("{cell:bgColor=" +
CASE WHEN T1.'Consultation' <= "300" THEN "#FA7E70"
WHEN T1.'Consultation' > "300" AND T1.'Consultation' <= "700" THEN "#FFE784"
ELSE "#8FCA7D"
END
+ "}" + "$" + T1.'Consultation' + "{cell}")
AS 'Consultation'
FROM T*
The result looks like this.
If you have a table with more columns, duplicate the query and use the right conditions according to the data in your table.
Hope we inspired you to try out new tools and get more creative with your Confluence tables! Let us know what you think in the comments.
Natalie Paramonova [Stiltsoft]
Product Manager
Stiltsoft
Poland
26 accepted answers
0 comments