2 replies [Last post]
gidmeister
gidmeister's picture
Offline
Regular
NY
Last seen: 6 years 2 weeks ago
NY
Timezone: GMT-4
Joined: 2011-03-01
Posts: 47
Points: 93

I tried using CSS to put a border around the TR tag of a table. I found it did not work. The border doesn't appear at all.

So instead, I tried putting the border around each TD of the TR. So suppose there are 5 TDs in the TR.
I might style TD #3 as having border-top and border-bottom of solid, red, etc.
For a TD all the way at the left, I would also add a border-left (of solid, red, etc).

The problem is though that when you view the CSS, you can see the boundaries between each TD. So even though the red line does go around the entire set of TDs, it is broken up. There are annoying white breaks between cells.

I tried using a padding and a margin of zero between cells, and I also tried a border-width of zero, between cells, but it doesn't help.

Is there a solution to this?
Thanks
Gid

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 2 weeks 1 day ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

Hi gidmeister, Look into

Hi gidmeister,
Look into Border-spacing

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 6 hours 40 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9767
Points: 3849

See §17.6 Borders,

See §17.6 Borders, border-collapse.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.