Problem with automatic multiple column sort and table header background colors
-
Hi all,
I’m using the WP-Table Reloaded and I have a multiple column sort applied to it automatically when a user enters the table page. My problem is now, that I would like to use the CSS code below to only change the background color of column-6 when the page is loaded.
.wp-table-reloaded-id-2 .sorting_asc, .wp-table-reloaded-id-2 .sorting_desc { background-color: #ffbaba!important; }
However, when I use multiple column sort, it changes all the sorted column headercell’s bgcolor to #ffbaba.
I have tried the following code:
.wp-table-reloaded-id-2 .sorting_asc, .wp-table-reloaded-id-2 .sorting_desc { background-color: #dddddd; } .wp-table-reloaded-id-2 .row-1 .column-6 { background-color: #ffbaba!important; }
This code works OK when the page is loaded for the first time, then the column-6 gets the correct background color. But then comes the problem when the user sorts another column. The column-6 still is left with the bgcolor #ffbaba and the “new” sorted column gets bgcolor #dddddd. What I would like to achieve, is that when the user sorts some column, it changes the column-6 to #dddddd (if column-6 isn’t the new sorted one) and the new sorted column gets bgcolor #ffbaba.
Is there a way to get this working? With some Javascript maybe?
Thanks for your replies!
- The topic ‘Problem with automatic multiple column sort and table header background colors’ is closed to new replies.