1

I'm trying to get ride of the last column in each table EXCEPT for the last table on the page. Is there a way to do this in css?

Here is what I have, and it doesn't seem to be working...

table:not(:last-child) tr td:last-child {

}

If this can't be done in css, please just let me know. :)

2
  • This works as is, in chrome. jsfiddle.net/SLjDU Commented Aug 5, 2011 at 18:58
  • Safari 5.1 as well. (Updated from last comment to make it easier to differentiate tables.) Commented Aug 5, 2011 at 19:03

1 Answer 1

2

You may want to use table:not(:last-of-type) instead, in case there are other elements after that last table in your page:

table:not(:last-of-type) tr td:last-child {
    display: none;
}

It also depends on the browsers you're testing in. No version of IE older than 9 supports the pseudo-classes being used.

Sign up to request clarification or add additional context in comments.

1 Comment

Ahh yes that may be a problem seeing as I need to program for at least IE7. Thanks you for the helpful information. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.