Miomir Dancevic
Miomir Dancevic

Reputation: 6852

CSS :nth-child in IE8

I am trying to make some nth-child to work in ie8, this is example of rule i have, but as you may know it will not work in i8

th:nth-child(n+3) {
    text-align: center;
}

But it has to work in IE8, i know in ie8 that first-child is supported, and easy can use like

td:first-child + td + td

But I don't know how to do when i have (n+), does anybody knows how to accomplish this to work in ie8 but from as you may see third child?

Upvotes: 1

Views: 69

Answers (1)

pavel
pavel

Reputation: 27082

If you have fixed number of elements, you can define them manually, it's the only way using pure CSS without classes in your HTML markup.

td:first-child,
td:first-child + td + td + td,
td:first-child + td + td + td + td + td + td,
td:first-child + td + td + td + td + td + td + td + td + td {...}

http://jsfiddle.net/63aw8yhv/2/

Upvotes: 2

Related Questions