2 replies [Last post]
gidmeister
gidmeister's picture
Offline
Regular
NY
Last seen: 7 years 36 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: 5 days 6 hours ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5344
Points: 2965

Hi gidmeister, Look into

Hi gidmeister,
Look into Border-spacing

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 year 12 weeks ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

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.