Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
FranciscoQ
Partner - Creator
Partner - Creator

Coloring alternate rows in a straight table

Hi, I would like to know if there is a way to have a background with an alternate row shading.

I know you can type an expression like:

 

 if(Even(RowNo(TOTAL)), rgb(219,219,219), rgb(255,255,255))

 

But you have to type it in every measure or field in order to have the whole table with an alternate shading,

I'm wondering if there is a way to implement that style to the whole table, so every time I add a new measure or dimension, automatically has an alternate shading, or so I don't have to write the expression in all the columns.

Labels (1)
3 Replies
Lisa_P
Employee
Employee

Try using the P&L Pivot in the Visualization bundle, it will do this automatically

anat
Master
Master

chris_djih
Creator III
Creator III

If you don't want to do this in every table manually, you should consider doing it by changing your theme.css.

This are the needed lines:

 

/* -- stragiht tables: odd row white-- */
.qv-object-table .qv-inner-object .qv-object-content-container .qv-grid-object-scroll-area table tr:nth-child(even) {
    background: #ffffff
}

/* -- stragiht tables: odd row gray -- */
.qv-object-table .qv-inner-object .qv-object-content-container .qv-grid-object-scroll-area table tr:nth-child(odd) {
    background: #EAEAEA
}

/* -- pivot tables: odd row gray -- */
.qv-object-pt .qv-inner-object .qv-object-content-container .qv-grid-object-scroll-area pt tr:nth-child(odd) {
	background: #EAEAEA
}

 

just add them to your theme.css

If you found help, mark the correct answer and give some likes to ALL contributors, that tried to help.