why cant i make 3px cell?

They have: 20 posts

Joined: Jan 2007

Im using dweaver i cant create a cell thats only 3px height!!
why? im trying to make a thin line between cells and i dont know how.
perhaps the correct question would be how do i make lines between cells?

Busy's picture

He has: 6,151 posts

Joined: May 2001

Use CSS

depending on where you want the line;

border-bottom: 3px solid black;

or border-left, border-right, border-top ... and of course black in my example can be any colour, even a RGB, just use the #000

I'm guessing your using tables, so something like this:

.bottomborder { border-bottom: 3px solid black; }

....

cell one
cell two

cell three no border bottom
cell four no border bottom

demonhale's picture

He has: 3,278 posts

Joined: May 2005

In my experience, if you use cells or dive blocks and you assign a height lesser than you're default font size, it won't go that low... So if you want a 3px block for example, assign on it's CSS a font size lesser than 3px...

timjpriebe's picture

He has: 2,667 posts

Joined: Dec 2004

Dreamweaver automatically puts a non-breaking space -   - in the cell. Delete that, and you'll probably be fine.

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

timjpriebe;220396 wrote: Dreamweaver automatically puts a non-breaking space -   - in the cell. Delete that, and you'll probably be fine.

Correct, but some browsers require you to have something in that cell. I have a 1x1 px gif that I use for that.

Save & use this: http://www.pr0gr4mm3r.com/images/spacer.gif

They have: 20 posts

Joined: Jan 2007

pr0gr4mm3r;220399 wrote: Correct, but some browsers require you to have something in that cell. I have a 1x1 px gif that I use for that.

Save & use this: http://www.pr0gr4mm3r.com/images/spacer.gif

and which browsers would that be? i checked with Ieplorer and Firefox and they seem to be fine with very narrow cells!!! tha non breaking space worked just fine!!!

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

I believe it was IE. It was a while ago when I discovered that, so it may have been corrected in recent versions. When a cell's content was empty, it didn't show the cell at all. Since " " made the cell as high as the font size, I used the 1 px gif.

They have: 20 posts

Joined: Jan 2007

so using the 1px gif makes it as tall as u like? is that it?

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

You still specify with width & height in the cell properties, so yes.

demonhale's picture

He has: 3,278 posts

Joined: May 2005

well as I said, without using an image for spacers, use smaller font sizes inside the div cell...

He has: 629 posts

Joined: May 2007

demonhale said:

Quote: So if you want a 3px block for example, assign on it's CSS a font size lesser than 3px...

But be aware that some of us set a minimum font size in our browsers that would override your font-size declaration. Sad

Back to the 1990s and spacer GIFs , methinks.

Cordially, David.

Cordially, David
--
delete from internet where user_agent="MSIE" and version < 8;

demonhale's picture

He has: 3,278 posts

Joined: May 2005

you have a point there, but when the font controls are increased, if purely for design purposes the page elements should increase with it with the fonts in this method... or you can use nested divs, with the smaller div inside... just a thought...

He has: 629 posts

Joined: May 2007

@demonhale:

But I'm not talking about "when the font controls are increased" - I'm talking about the minimum font size setting. See this article about the effect it has.

Cordially, David
--
delete from internet where user_agent="MSIE" and version < 8;

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

webwiz wrote: Back to the 1990s and spacer GIFs , methinks.

Wow. That's scary (but true). I think demonhale is trying to angle this person towards just using a div (although that might not always be the best thing to do). Although the number of people that have minimum font size set are few and I doubt the page will be unusable for those people if the font size were a little larger than 3px. Also, wasn't it Netscape Navigator 4 that required something be in the table cell?

My suggestion: test it with nothing in the cell (making sure the   is removed) in all modern browsers, if it works don't worry about the spacer.gif Smiling

a Padded Cell our articles site!

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.