Override tablesorter CSS

Posted by user1712810 on Stack Overflow See other posts from Stack Overflow or by user1712810
Published on 2012-11-15T16:54:13Z Indexed on 2012/11/15 17:00 UTC
Read the original article Hit count: 201

I am using jquery tablesorter. When the page loads, I have a code to highlight the background color of certain rows in the table.

Since tablesorter is used I guess it overrides the css and not allowing to change the background color of the rows.

This is the code. This function automatically loads when the page gets loaded. I removed table-sorter to the table and tried this. It works. I have to get it to work with the table-sorter applied.

        $(document).ready(function() {
          var row, len, results;
          row = 0;
          results = [];
          while (row < len) {
            if ($("#tab1 #example_"+row+"chkbx").is(":checked")) {
              $("#tab1 #example_" + row).css("background-color", "#c6b79f");
            }
            row++;
          }
          return results;
        });

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery