I think that the problem is most likely outside this. IE is known to have problems with getting the length of the rows collection. Also looking up rows/cells can be slow so use local variables so that rows/cells does not have to be returned more than once. For example:

In this case it is pretty obvious but this is very important when looping. You should never do rows/cells.length in the test that occurs in every loop iteration.

erik

I need to color a row or some rows in a table and I do it like this function applyStyle(oTR, sClass) { var i = 0; var ii = oTR.cells.length; while (i < ii) { oTR.cells[i].className = sClass; i++; } } But when I apply it to 20 or above rows it takes about 5-10 seconds Is there a way to optimize it?

Reply

Name:

Email:

Subject:

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto:
are converted to links.