Highlight row in table
Highlight row in table
Hi,
I have want to display to the user a mutually exclusive row to the
user. That is only one row is highligted at a time. The user clicks
a row and it is highlighted.
I have the following code:
table.find("td").css({background: "#ffffff"});
table.find("tr").removeClass("hoverrow");
if(!row.hasClass("hoverrow")){
row.addClass("hoverrow");
$.each(row.children("td"), function(){
this.style.background = "#FFF880";
});
}else{
row.removeClass("hoverrow");
$.each(row.children("td"), function(){
this.style.background = "#ffffff";
});
}
The first 2 lines clear all the rows in the table.
The problem is that it is very slow if there are a lot of rows.
Can anyone think of how I can make this perform better?
Cheers
Paul