Sorted Column Shading

Sorted Column Shading

jdadwilsonjdadwilson Posts: 127Questions: 30Answers: 1

I use several datatables throughout my site several of which allow the sorting of selected columns. I can change the CSS to adjust the row colors for striping and also set the colors for shading sorted columns.

Is there another way to set the column shading for sorted columns? Something that can be set in the datatable initialization for example.

TIA for any assistance.

jdadwilson

Answers

  • john_ljohn_l Posts: 45Questions: 0Answers: 12

    There should be classes (sorting_1, sorting_2, etc) added to both the TH and the TD cells of the sort columns - you can use those for CSS selectors to get whatever styling you want.

  • jdadwilsonjdadwilson Posts: 127Questions: 30Answers: 1

    John,

    Thanks for the response. As stated in my question, I can set the shade colors in the CSS to specific colors. The issue is that to do so I must futz around with the colors to get something that looks good with the selected row colors. What I would like to do is to set the row colors (even, odd) and then have a way to set a parameter in datatables that would adjust the sort columns accordingly.

    jdadwilson

  • john_ljohn_l Posts: 45Questions: 0Answers: 12

    Hmm, I don't know of any init options for that (I'll let Allan respond to that), but I don't see why you can't do what you want in CSS. You might need to do a whole load of definitions (for each possible combination of odd/even/sorting/selection), but should be possible.

    It might also be possible to do something using Opacity on the background so that the various class definitions can be cumulative - good luck if you give it a try...

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    Sounds like you might want the theme creator :-). If that doesn't give enough options for you, then the easiest way is to use the SCSS file and customise that, then compile it.

    Allan

This discussion has been closed.