View Full Version : Border just around the cell


Makar
10-31-2004, 11:03 PM
I've been trying to get this to work, but now I'm wondering if it can work in the first place:

TD.top
{
background-color: #00FFFF;
border-style: solid;
border-width: 1 px;
border-color: #006699;
}

(Then I put td class="top" in the appropriate tag)

If I use TR.top and put it in the <tr> tag instead, won't that put one border around all the cells in the row? I can't even get that working either, so there was no way to test it. It seems the only way I can put a border around each individual cell is to assign a border to the whole table as well, which I don't want to do. Is there a way to make this work?

Makar
11-10-2004, 08:05 PM
Alright well, I got the borders working. Dunno why that code didn't work in the first place...but anyway, a new problem has developed. The top of the cell is one pixel like it's supposed to be, but the rest of the border is four pixels thick! Err...maybe three; I haven't exactly counted. But why is it doing that? Here's an example:

http://melicbot.com/darnborder.html

I can't for the life of me find the problem! It's so discouraging...

Rosey
11-10-2004, 09:39 PM
Try just doing this:

TD.top {
background-color: #00FFFF;
border: solid 1px #006699;
}

kittycat
11-10-2004, 09:40 PM
Or get rid of the space between 1 and px... you currently have 1 px, make it 1px and it works.

Makar
11-11-2004, 05:16 PM
Oh! How silly of me...I guess whitespace really does make a difference. :o Thanks for your help.