Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

barbarat January 18, 2015

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

1 vote
Aleš Laňar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 20, 2015

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

table.confluenceTable td.confluenceTd.highlight-grey {
	background-color: #909090;
}
0 votes
Alexej Geldt
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 19, 2015

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

cheap but powerfull. Might work for you too.

 

Meghan Arad
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 5, 2020

Here's how...UPVOTE to get more traction on this feature request:

Select columns or rows in a table to apply formatting

0 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 18, 2015

You can use the Table Plus Macro. See Styling Table Rows.

Sam Mingolelli April 20, 2016

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

Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 21, 2016

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. 

0 votes
Stephen Deutsch
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 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
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events