Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rearranging table rows through jQuery giving undesired results in IE

I am trying to rearrange the table rows in the preformatted HTML table.The HTML table is being displayed as in the below fiddle.. My total HTML is given in this fiddle.

Initial Look of the table

I am trying to rearrange the <td> with texts containing texts "One" and "Two".I am identifying those "One" and "Two" rows using "rowspan" attribute. If you see the below fiddle in non IE browser you can have a clear picture on what i am trying to do..

After rearranging

But the problem is, This Code is working fine in browsers other than IE(I have tested in Chrome and Firefox). I am unable to find where the problem is...

Please help me to correct my code to have cross browser compatibility.

like image 559
Exception Avatar asked Nov 01 '11 15:11

Exception


1 Answers

Thanks for your answers, I found the problem.. IE is assigning the index from 1 to the elements. So giving

 find('td.mrGridCategoryText:eq(0)')

is giving undesired results, If i change it to 1 then i am getting correct result in IE but not in others.Check this fiddle http://jsfiddle.net/J7WPb/23/
So

 i need to give eq(0) if other browsers and eq(1) if IE :-(

Thanks again.

like image 106
Exception Avatar answered Oct 21 '22 23:10

Exception