Forum Moderators: open

Message Too Old, No Replies

Netscape 4 - a 3 cell table with 1 pixel cells on the outside won't display

         

Tonearm

5:56 pm on Mar 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm having trouble getting Netscape 4 to display a 100% table with a single row and three columns where the outer two columns have a width of 1 and the inner column stretches to occupy whatever is left over. I know Netscape 4 is notoriously bad, but it seems like it should be able to do this. Can anyone show me how it's done?

DrDoc

6:31 pm on Mar 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What does your markup look like?

Tonearm

6:40 pm on Mar 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here it is. I hope this displays OK.

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="1"><img src="spacer.gif" /></td>
<td width="100%">test</td>
<td width="1"><img src="spacer.gif" /></td>
</tr>
</table>

PatomaS

10:55 pm on Mar 16, 2004 (gmt 0)

10+ Year Member



Hello

:)

Well Netscape 4 is not exactly bad, but is not exactly good as well...

But about your code... try this...

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="1">&nbsp;</td>
<td width="99%">test</td>
<td width="1">&nbsp;</td>
</tr>
</table>

I think this will work...

Hope it helps

Bye

Tonearm

6:30 pm on Mar 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thank you but that actually doesn't work either. If you color the outside cells with bgcolor="#000000" you can see that they aren't 1 pixel wide. Any other ideas?

tedster

8:22 pm on Mar 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've played around a bit with this - and I don't think NN4 will cooperate.

A 1 pixel column cannot hold text, so you must want this for some sort of decoration/aesthetic reasons. I'd look for another approach to get the visual effect you're after.

Tonearm

10:21 pm on Mar 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, that's true I am after a visual effect. I'm actually building an e-commerce site where the only graphics involved are the photos of the products. The logs will look great and it will be highly cool.

What do you suggest for 1 pixel wide of vertical blackness I need on either side of a bgcolored cell?

tedster

10:33 pm on Mar 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use a CSS class for that cell, declaring rules for border-right, border-left, and background-color.

tedster

10:38 pm on Mar 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Whoops, sorry - NN4 won't do that either.

Honestly, when it comes to NN4, I would not concern myself with anything aesthetic - just functionality and legibility if you really MUST support the antique at all.

john_k

7:49 pm on Mar 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can use bgcolor for the TD.

Also - is spacer.gif a 1x1 pixel image? If so, you might want to include the dimensions in your markup (the original markup you posted).

The set of markup with the &nbsp; entities will cause the 1st and 3rd columns to be as wide as a space in whatever font is being used.

I can't recall for certain, but it seems like NN4 didn't support percentages in width/height attributes for table components. (maybe it was just IMG tags).

tedster

7:58 pm on Mar 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



john_k, I experimented with those variations, trying to find a solution for Tonearm. But NN4 consistently created a table cell that was about 15 px wide, even with the image dimensions explicitly stated.

NN4 has many arbitrary limits -- minimums and maximums for various elements -- written into their internal rendering engine. I've stumbled over parallels in lots of situations throughout the years.

isitreal

8:16 pm on Mar 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have several sites up that use the technique Tonearm is trying to get running, they were made to work and display correctly on ns4 and they work fine, 1px borders using td width and height 1.

The problem is almost for certain how netscape is handling the sizing of the center cell, that's the only place the issue could be coming in.

You can see this if instead of width=100% for the table you change it to width=752, then make the left and right cells 1px wide, and the content cell 750px, this should display fine, I just took a look at my sites in ns4 and they display fine, 1px borders as intended.

I went and tested this, what is happening is that you can't mix percent and pixel measurements in the table sizing, ns4 is translating the width=1 to width=1%, you can see this quite easily by changing it to 2%, that doubles the border sizing.

If you declare an absolute size on the table, it will display fine, 1px borders, no problem. Your other choice is to simply use a 1px border on the table itself, <table border=1 bordercolor=black cellspacing=0 and so on, ns4 supports that fine.

Tonearm

12:52 am on Mar 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for the info guys. I played with this for a bit and found that if you remove the center cell's width declaration entirely, the "extra" black shrinks in accordance with the amount of content in the center cell. For example, the following center cell shrinks the black quite a bit:

<td>test test test test test test test test test test test</td>

Weird.

How can I get a border="1" border to look like a simple 1 pixel wide black line? The line always comes out looking kind of 3D for me.