Topic: table borders for each cell in css (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: purgatory |
![]() Is there any way to specify that each cell have a border in the table tag of a CSS file? For instance, if i specify that a table have a 1px border in the css file, it only shows around the outer edges of the table. If I do a border=1 in the actual html table tag, it puts a border around each cell in the table. How can I do this in CSS? |
Bipolar (III) Inmate From: the uterus |
![]() You need to specify that the actual cells have a border, like this... |
Bipolar (III) Inmate From: purgatory |
![]() I tried doing that, but when you put a bunch of cells up against each other, it makes a 2px border instead of a 1px border. |
Paranoid (IV) Inmate From: North Coast of America |
![]() Add this to your CSS-- border-collapse: collapse; |
Bipolar (III) Inmate From: the uterus |
![]() If you only want a 1px border throughout the table you could do something like this.... |
Paranoid (IV) Inmate From: North Coast of America |
![]() Rooster: Have you actually looked at that CSS on a table? It gives a horrible illusion of what I think acidbox is looking for. The corners don't line up and the gaps between the cells show plain as day. Besides, even if it worked, it's an ugly, bloated kludge of a solution. |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
![]() Brucew: While Rooster's solution requires a few more CSS properties or HTML attribute to close up the gaps you mentioned, I have seen it work and used it myself in the past. Nonetheless, you are right that border-collapse is the correct way to handle this. |
Bipolar (III) Inmate From: the uterus |
![]() Hey, I'm just saying you ~could~ do that. Do whatever you think is best for the situation. I'm really not going to twist anyone's arm; I'm simply throwing out options. An option that could be made to work with earlier browser versions, as opposed to the "collapse" style which as you said is only implemented in later versions. |