colouring rows based on 'duplicate alternating groups'

colouring rows based on 'duplicate alternating groups'

mattblokemattbloke Posts: 4Questions: 0Answers: 0
edited January 2014 in General
Hi, say I have a table as below, how would I colour rows 1-3 a colour and then row 4 a different colour and then row 5-6 the same colour as the first set? All based on the value in the first column.

Or in other words I want alternating row colours, but by 'groups' of identical values in one column. I can't use code like 'If 1 THEN, If 2 THEN etc...' because there can be infinite values.

col1 col2 col3
1 2 3
1 7 7
1 3 3
2 9 0
3 1 1
3 9 2

Many thanks, Matt

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    You would need to use the fnDrawCallback callback function to loop over the rows shown in the table and add class information as appropriate. There isn't built in logic to provide that ability.

    Allan
  • mattblokemattbloke Posts: 4Questions: 0Answers: 0
    thank you
This discussion has been closed.