Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Nov 2007
    Posts
    682
    Thanks
    319
    Thanked 1 Time in 1 Post

    Is there a way to select table cells without a class?

    Basically, I don't really want to make another class just to make a cell's width longer, I was wondering if I could do something like this (similar to JavaScript) to select the blue cell.

    .tableclass tr th[1] { }

    This is what it looks like in Photoshop (I always make a design in Photoshop first).


    Here is the basic structure of the table.


    Thanks guys.

  • #2
    Regular Coder
    Join Date
    Nov 2007
    Posts
    682
    Thanks
    319
    Thanked 1 Time in 1 Post
    Found the answer..

    .className:nth-child(1)

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,880
    Thanks
    6
    Thanked 1,035 Times in 1,008 Posts
    You can also do .tableclass tr:first-child th:first-child + th, or if you have a thead row group (which I hope) .tableclass thead th:first-child + th. This will also work in IE 8 and 7.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •