Alternate raw colors when autofilter

Hello,

I would like to alternate the raw colors of a calc spreadsheet even if the table is filtered.
for example one red line, one white line.

In “conditional formating” the formula : =MOD(LIGNE();2)=0 doesn’t work well when the table is filtered because this is testing if the raw is even or not. Consequently I will get for example two red lines, 5 white line, … I would like the red/white color to alternate even if the table is filtered.

Does anyone have a solution for this case ?

Thank you.

hello, I have found the answer on an other forum but I do not understand how to set the conditional filtering. Could someone explain the steps to set up the filter with subtotal ?
link to the solution :
https://forum.openoffice.org/en/forum/viewtopic.php?f=9&t=8716

if someone could explain, thank you

Something like. ISODD(SUBTOTAL(2;$A$1:$A2))
Needs to count on a column with data in every row.

Hello,
Thank you very much !
I have just noticed my mistake : I was not selecting the good cell range. I have selected a1:c9 instead of a2:c9 like on your example.
Thank you for your help.