Alternate row colour

18 February, 2022 03:41:48
Topics: 3
Messages: 7
Hi!

Trying to create a table with alternate row colour, but when I use this code in the CSS section of the HTML element, it doesn't work:

tr:nth-child(even) {background-color: #f2f2f2;}

Any idea ?

Thank you,

Stephane
18 February, 2022 06:22:50
E2Pdf
Support
Topics: 7
Messages: 3330
Hi,

Unfortunately E2Pdf currently doesn't support pseudo classes. We are continuously working on extending "HTML" support however currently it's not available.

The only way is to add class to "tr" some class and add to CSS section:

.class {background-color: #f2f2f2;}

However, as we understand you are using "preg_replace_filter" which will not be possible to make it compatible with as it can be removed rows which going 1 by 1. Unfortunately there is no any ETA when pseudo classes will be supported.

If it will be any changes in its support we will update current thread. Sorry for the inconvenience.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
18 February, 2022 07:13:28
Topics: 3
Messages: 7
Understood. We will find another design trick ;)

Thanks again for your quick and great support !

Best.

S.