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
    Jan 2005
    Posts
    470
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Affecting only TR within certain table

    How would I affect all TRs within a certain table without having to assign a class to each TR element?

    I thought it was something like ".ClassName table tr {vertical-align:text-top;}" but that obviously doesn't work.

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,695
    Thanks
    6
    Thanked 1,011 Times in 984 Posts
    If the table whose rows you wanna address doesn’t have an ID or class yet assign it (<table id="whatever"> and apply the styles like that:

    Code:
    #whatever tr {…}
    or if it has a class
    Code:
    .classname tr {…}
    What you have (.ClassName table tr {vertical-align:text-top;}) would only apply to a table within an element with class ClassName.

  • #3
    Senior Coder koyama's Avatar
    Join Date
    Dec 2006
    Location
    Copenhagen, Denmark
    Posts
    1,246
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Apart from that vertical-align does not apply to the table-row element.

    It only works in Firefox and IE due to a bug. But it won't work in for example Opera 9. Check browser comparison chart.

    You should apply vertical-align directly to the table-cell (td element).


  •  

    Posting Permissions

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