Results 1 to 2 of 2

Thread: CSS question?

  1. #1
    Join Date
    Dec 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default CSS question?

    I have a table with 61 rows and 4 columns. Names, email, phone,
    affiliation.

    I want to have a solid 1px bottom border for each row. But I am not
    smart enough with CSS to figure out how to do this without giving a
    class to each TD (there are 244 of them) And I want there to be about
    8px of margin underneath that border, or before the next person's name.

    How could I do this? I just want a bottom border. I've tried giving the
    <tr> a class that has a border-bottom assigned to it, but haven't been
    able to make it work.

    Thanks!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,982
    Thanks
    43
    Thanked 3,198 Times in 3,160 Posts
    Blog Entries
    12

    Default

    Something like:

    Code:
    #addresses {
    	border-collapse: collapse;
    }
    #addresses td {
    	border-bottom: 1px solid #000;
    	margin: 4px;
    }
    HTML Code:
    <table id="addresses">
    <tr>
    <td></td>
    </tr>
    </table>
    If there are a few td's in that table that you don't want to have those styles, give those a class and set their styles differently. If they are all in the same row(s), give the row a class and set its descendant element td's styles, example:

    Code:
    .different td {
    	border: none;
    }
    <tr class="different">
    <td></td><td></td><td></td>
    </tr>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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