I need help with styling a table that contains variable data, grouped by columns (Month and Year).
My goal is to alternate row colors for each group of data. For example, all rows under Feb 2016
would have class=a
, the next set of data would have class=b
, and so on. It's like an odd/even pattern but applied to multiple rows based on their values.
https://i.sstatic.net/hwn37.png
In the image above, there are 3 datasets: Feb 2016
, June 2016
, Jan 2017
. The first 4 rows would have class=a
, rows 5 and 6 would have class=b
, and the last row would go back to class=a
.
Although I managed to do a simple alternating row color scheme, this task seems more complex.
Here is the dataset in a fiddle: https://jsfiddle.net/yo04vxoa/
Any guidance on how to achieve the desired result shown here: https://jsfiddle.net/yo04vxoa/3/ would be greatly appreciated!
I'm struggling to correctly assign classes to rows based on similar data in the month/year columns. Any assistance would be helpful.