Web Hosting Talk







View Full Version : advanced html tables


wuzgood
04-04-2004, 11:49 PM
can a cell be 1 pixel wide? i'm thinking about doing something with them for a pixelborder but i don't think those work.

Website Rob
04-05-2004, 12:33 AM
It can if you put a 1 px image in it. Presuming it's a cell in a column, the column would have to be 1 px wide all the way down the TABLE.

ic3d
04-05-2004, 06:01 AM
You can, like website rob said just put a 1 pixel spacer in there and fill the rest up with a backgroundimage or color.

wuzgood
04-05-2004, 11:49 AM
wait so i can put like a transparent pixel spacer image and also set a background color? if i don't put anything and just have like a set background color, it wont work righ?

serialbeggar
04-05-2004, 12:52 PM
I hear Netscape browsers (at least the older ones) may collapse the cell if there's nothing in it.

ic3d
04-05-2004, 03:41 PM
Originally posted by wuzgood
wait so i can put like a transparent pixel spacer image and also set a background color? if i don't put anything and just have like a set background color, it wont work righ?

That's true. And the post after you is true as well. That's why you need a transparant pixel, so older browsers won't collapse the frameset. Newer alternative browsers stop the collapsing, but they don't just show the background unless there is something in there, and there we have the spacer again. :)

wuzgood
04-05-2004, 06:42 PM
so do i put the pixel spacer thingermashitter as the background or just an image? plus, why the hell doesn't netscape navigator support HEIGHT? i find that stupid... and annoying

ic3d
04-05-2004, 07:09 PM
You put that spacer as an image. Then you select your background or backgroundcolor.

You can solve your height problems with spacers as well. Just stretch the 1px to the height you want.


<img src="pixel.gif" width="1" height="choose">

Website Rob
04-06-2004, 03:46 AM
That will not work, ic3d. Columns & Rows are uniform, you cannot have two TD in the same TR that are different heights, for example. One can alter the apperance of the 'look' after parsing, but the coding must provide for a uniform height.

Contrary to what was mentioned by wuzgood, regarding height -- and we're not sure 'height' of what is being referred to -- all versions of Netscape/Mozillia do support 'height', for both TR & TD because Netscape first introduced TABLES to begin with.

I think more testing/learning is in order, before one can truely say that a Browser cannot do this 'or that.

Rich2k
04-06-2004, 04:51 AM
However the height attribute of <table> is not a W3C standard but if <td> and <tr> it is.

ic3d
04-06-2004, 05:45 AM
Originally posted by Website Rob
That will not work, ic3d. Columns & Rows are uniform, you cannot have two TD in the same TR that are different heights, for example. One can alter the apperance of the 'look' after parsing, but the coding must provide for a uniform height.


Ofcoarse, but i kinda thought he already knew that, cause it's real table basics.

Website Rob
04-06-2004, 06:04 AM
I would think so also but mention for it for clarification, to anyone reading this thread now or later. What you say, ic3d, also applies to what Rich2k mentioned. Although those that understand (study?) HTML coding, know that there is no such attribute as 'height' for a TABLE, I find it surprizing at just how many people use it. :)

ic3d
04-06-2004, 06:21 AM
Yeah it's funny, i think it's caused by iexplorer. When you put the height in a table it shows you the height. I know i use it by accident once in a while cause when i first stdied HTML i just grabbed sites and looked at theire codes to learn how they managed to do things. Most of them used height :(
Long time after that i found w3c, but the height is kind of rusted in me :P

Thanatoz
04-06-2004, 01:22 PM
I am not sure if this is what you are looking for
If you want a 1 pixel cell for border, you can use this:

<table width="300" height="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#000000">
<table width="300" height="300" border="0" cellspacing="1" cellpadding="5">
<tr>
<td bgcolor="#CCCCCC" valign="top">Testing 123</td>
<td bgcolor="#DDDDDD" valign="top">Testing 123</td>
</tr>
</table>
</td>
</tr>
</table>

ic3d
04-06-2004, 04:39 PM
That works as well, only problem with that is that you can use websafe colors only and no background. You can't do anything with the corners that way either.

wuzgood
04-06-2004, 10:29 PM
yea i understand that that works but i already found a way to do it. thnx anyway

another question.. can like... a pixel shim's with be like... a percentage