User login

Reply to comment

tablesorter

There is a way around it. But if you use it, Colorize will lose most of its functionality, keeping only the striping.

Find the following piece of code in jquery.colorize.js:

return this.each(function(){
jQuery(this).find('tr:odd').css('background', options.bgColor);
jQuery(this).find('tr:even').css('background', options.altColor);

Now, change the last 2 lines to the following:

jQuery(this).find('tr:odd td').css('background', options.bgColor);
jQuery(this).find('tr:even td').css('background', options.altColor);

This will allow Colorize to overide the style settings for individual table cells set in the stylesheet.

If you want to use the sorting functionality from the tablesorter plugin, you could use something similar to the following code on (document).ready:

$(".tablesorter").tablesorter();
$('.tablesorter').colorize();
$($.tablesorter.defaults.headerList).each(function (index){
$(this).click (function (){
setTimeout(function() {
$('.tablesorter').colorize();
},10);
});
});

Reply

The content of this field is kept private and will not be shown publicly.