Is there a way to alternate row colors in a table?

Sometimes it's hard to read a lot of data in a table. Is there a way to alternate the row color to something like default white and a really light grey?

4 answers

For that the best way could be apply CSS to global. Insert this:

table.confluenceTable td.confluenceTd.highlight-grey {
	background-color: #909090;
}
0 vote
Stephen Deutsch Community Champion Jan 18, 2015

Unfortunately, confluence cloud doesn't allow you to set custom CSS.  But, if you want to at least see it in your browser, you could run the following command in your javascript console:

$("tr:nth-child(even)").css({"background": "rgb(250,250,250)"});
Stephen Deutsch Community Champion Apr 21, 2016

Actually, Confluence Cloud now sort of lets you set CSS globally.  If you change the Global/Space Look and Feel, you can insert the following in the header/footer:

{css}.confluenceTable tr:nth-child(2n+3) {background: rgb(250,250,250)}{css}

This will also work in Confluence Server if you have the Content Formatting Macros installed.

I realize this would work, but it feels wrong to me that the creator or the commercial product would be blatantly advertising it.

I disagree, I think most people on this forum appreciate ideas for solving their problems with whatever is available (built-in, free, or commercial) and they can choose to ignore commercial solutions if they want. More-over a lot of people who already own the add-on find out about features they may not be aware of. 

we have created our own UI plugin, which basically overwrites some of the default CSS.

cheap but powerfull. Might work for you too.

 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

967 views 23 12
Join discussion

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