Forum Moderators: not2easy

Message Too Old, No Replies

setting parameters for all cells in a table

         

Stark

10:21 pm on Mar 3, 2005 (gmt 0)

10+ Year Member



This should presumably be very easy to answer.

I have the following

<table class=my_table>
<tr>
<td>something</td>
<td>something</td>
</tr>
<tr>
<td>something</td>
<td>something</td>
</tr>
<tr>
<td>something</td>
<td>something</td>
</tr>
</table>

How do I in css set each of the cells of this particular table to have a certain property. e.g. I want the padding of each cell to be 5px.

I can't set it in the table because it's a cell property but I can't work out how to reference all the cells within the table without specifically assigning them to a class.

Can someone please explain for me?

MWpro

11:29 pm on Mar 3, 2005 (gmt 0)

10+ Year Member



Try something like this:

<style type="text/css">
table.my_table td {
padding: 5px;
}
</style>