Fading in table cells
Fading in table cells
Hello!
I have a button which will add a row into a certain spot into a table. I accomplish this with the following code (no problem here):
- $('#tbody1 > tr:last').before(rowHTML);
This works in both IE and Firefox.
However, I would like to have the row fade in. Since IE will not allow you to perform this on a table row, I've tried to perform this task on all of the cells within the row. To do this, I've tried the following code, immediately after the preceding line:
- $('#tbody1 > tr:nth-last-child(2) > td').hide().fadeIn();
This works like a charm in Firefox. In IE however, it hides all the table cells, but only fades in the first.
As an alternative, I've tried to set the fadeIn() as a callback for the hide, like this:
- $('#tbody1 > tr:nth-last-child(2) > td').hide(0, function() { $(this).fadeIn();});
Again, this works nicely in Firefox, but fails in IE. This time however, only the last of the table cells appears.
Does anybody have any insight here?