Log in

View Full Version : CSS question?



Spring0105
12-17-2009, 09:08 AM
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!

jscheuer1
12-17-2009, 12:30 PM
Something like:


#addresses {
border-collapse: collapse;
}
#addresses td {
border-bottom: 1px solid #000;
margin: 4px;
}


<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:


.different td {
border: none;
}

<tr class="different">
<td></td><td></td><td></td>
</tr>