JQuery: nth-child does not work in IE
nth-child
not supported in IE 6-8. IE9 supports it. See here .
See this question for a possible workaround.
Something else seems to be wrong. Your code should work even in IE6, although IE <9 does not support nth-child, the jQuery (Sizzle) selector mechanism implicitly processes it for you.
Release this code:
<script> $("ul").remove(); var ul = $("<ul>"); for (var i = 1; i < 100; i++) { $("<li>", { "class" : "list-item", html : i }).appendTo(ul); } ul.appendTo(document.body); $('.list-item:nth-child(5n)') .after('<div class="clear">Clear!</div>') </script>
You see "Clear!" comments? Even in IE6 you have to ...
Actually there is a script that you can load into your js folder and add some conventions to your header, and nth-child will work in IE 6, 7 and 8. you can find out more here and if you need to use rounded corners , you will need to install this other script called curvycorners.js They really save time. Good luck
The nth-child jQuery selector does not work in some cases involving complex selectors in IE8.
The following needs to be changed in IE8.
//Works fine in IE9+, FF and Chrome. //dataColumn = jQuery('.table-header div.rf-edt-hdr + div table table tbody > tr:nth-child(1) td:nth-child(1)'); //headerColumn = jQuery('div.table-header > div.rf-edt-hdr table table > tbody > tr td:nth-child(1)'); dataColumn = jQuery('.table-header div.rf-edt-hdr + div table table tbody > tr').eq(0).find('td').eq(0); headerColumn = jQuery('div.table-header > div.rf-edt-hdr table table > tbody > tr td').eq(0);
NOTE. nth-child is based on 1 index. eq () is based on 0-indices.