Alternating Row Color with Repeated Headers | XM Community
Question

Alternating Row Color with Repeated Headers

  • 19 August 2019
  • 1 reply
  • 10 views

Currently, I have repeated headers for lengthy inventories. I would like to have the responses to alternate coloring along with the header for that response.
I have this as my code currently, but this only makes the headers a different color as this is the alternating row.

jQuery("tr.ReadableAlt").css({"background-color":" lightgray"});

Is there a good way to change or add to this code, to get the desired result.

1 reply

Userlevel 7
Badge +27

Hi there, try using the below:
jQuery("#"+this.questionId+" .ChoiceRow:odd").css("background","#F8F8F8");

Leave a Reply