I’m trying to fit some CSS to also work on IE7 and IE8 and I’m stuck with the :not() selector.
I need to select all table header cells except the last one. I’m currently using this:
th:not(:last-child)
which fails on IE7+8.
Are there any CSS only workarounds?
Thanks for some hints!
The way you ask it:
could refer to:
thof the table, wherever it could be found,thead>tr– and there could be more than onetrthere),thin each row.None of these cases can be solved by CSS understood by IE7/8 (resp. no solution in CSS at all,
th:last-childandth:last-of-type)EDIT: in one case, there could be a solution. If you exactly know how many
thelements there are in each row then you can select say the fourth one withth ~ th ~ th ~ th.See http://reference.sitepoint.com/css/generalsiblingselector for IE7/8 bugs (no comment allowed).
It’s up to you to modify this selector if there are only
thin a row (the+selector would be OK too) or if there are@colspanor@rowspanattributes (number of elements in a row != number of columns).