Conditional formatting of a SQL-Query result set (whole rows)

Andrei [errno] Community Champion Aug 01, 2013

re: sql-query macro

I am able to conditionally format individual cells in a table by updating a query to incluide smth like:

, CASE
    WHEN abc = 1 THEN '<span style="background: #9e9; border: 1px solid #999;padding: 1px 12px;">one</span>' 
    WHEN abc = 0 THEN '<span style="background: #e99; border: 1px solid #999;padding: 1px 12px;">zero</span>'
    ELSE '--'
END AS ABC

+ I set query output format as "html"

but would like to conditionally format the entire row = color it red, please :)
anyone has any ideas? Bob? :)

just thinking outloud... maybe storing a tr class in the last column and not display it?

2 answers

Look at the css and related parameters like columnAttributes and rowStyles. See Common parameters - they are shared by the SQL macros.

Andrei [errno] Community Champion Aug 04, 2013

thanks for your response. not sure how to apply this for condiitonal formatting though. I get the idea of applying a background for all rows or adding repeating patterns, but what if I need to color one particular row red if one of the fields triggers this condition? for example - this might be row number 14 out of 100.

Hello!

For conditional formatting in Confluence you may use CelesteCS Conditions for Confluence.

Thanks!

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

358 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you