Forum Moderators: not2easy

Message Too Old, No Replies

css inside table border

         

webgirl

1:13 pm on Apr 22, 2004 (gmt 0)

10+ Year Member



Hi,

This seems like such a basic thing that I can't believe I'm posting in about it but here goes - I've got a table that needs a border around and inside each row/column. When I use border: 1px it's only setting the border on the outside of the table....how do I get it to show the borders around each cell as well?

Sorry....I haven't had had a site needing table borders in a while!

Thanks,
Kath

choster

1:17 pm on Apr 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can set borders on the table headers and cells (<td>/<th>). If you do not want a "double border" (bottom border for the cell above plus the top border for the cell below, etc.), also add the property "border-collapse:collapse" to your <table> style.

You actually have a great deal of flexibility to control table presentation by attaching styles to <td>s or <th>s inside certain <tr> or <tbody> elements. It's too bad Mozilla doesn't support <colgroup> and <col>, which would make my life a whole lot easier.

[edited by: choster at 1:24 pm (utc) on April 22, 2004]

Bonusbana

1:18 pm on Apr 22, 2004 (gmt 0)

10+ Year Member



td { border: 1px solid #000; }

webgirl

1:32 pm on Apr 22, 2004 (gmt 0)

10+ Year Member



That's fantastic - thanks guys!