Forum Moderators: open

Message Too Old, No Replies

Netscape versus IE: difference in table cell background

         

geeky_girl

10:52 am on Jan 7, 2005 (gmt 0)

10+ Year Member



Hi,

Does anyone know why with IE both of my tables below display fine, but with Netscape only Table 1 displays OK? The only difference with Table 2 is that I have nested my inline tables in a parent table. But as you can see, I've lost my fraction bars in the second table.

I've searched everywhere on the web, and I've seen that Netscape can be quirky, but I can't seem to find a fix.

Thanks!
:)

*********************

<HTML>
<HEAD>
<BODY>
<H1>Table 1</H1>

<TABLE STYLE = 'display:inline' CELLPADDING = 0 CELLSPACING = 0 >
<TR><TD HEIGHT = 20>1</TD></TR>
<TR><TD HEIGHT = 1 BGCOLOR = 'BLACK'></TD></TR>
<TR><TD HEIGHT = 20>3</TD></TR>
</TABLE>
&nbsp;
<TABLE STYLE = 'display:inline' CELLPADDING = 0 CELLSPACING = 0 >
<TR><TD HEIGHT = 20>1</TD></TR>
<TR><TD HEIGHT = 1 BGCOLOR = 'BLACK'></TD></TR>
<TR><TD HEIGHT = 20>3</TD></TR>
</TABLE>

<H1>Table 2</H1>

<TABLE>
<TR>
<TD>
<TABLE STYLE = 'display:inline' CELLPADDING = 0 CELLSPACING = 0 >
<TR><TD HEIGHT = 20>1</TD></TR>
<TR><TD HEIGHT = 1 BGCOLOR = 'BLACK'></TD></TR>
<TR><TD HEIGHT = 20>4</TD></TR>
</TABLE>
&nbsp;
<TABLE STYLE = 'display:inline' CELLPADDING = 0 CELLSPACING = 0 >
<TR><TD HEIGHT = 20>1</TD></TR>
<TR><TD HEIGHT = 1 BGCOLOR = 'BLACK'></TD></TR>
<TR><TD HEIGHT = 20>4</TD></TR>
</TABLE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>

orion_rus

1:40 pm on Jan 7, 2005 (gmt 0)

10+ Year Member



because u could place tables only in a <td> element of the parent table. Good luck to you

Longhaired Genius

3:38 pm on Jan 7, 2005 (gmt 0)

10+ Year Member



No, the markup is valid. Maybe it is a bug. If you remove the style="display: inline;" from the nested table the td background shows up. I'm stumped. (I'm not going to ask why you want to do this.)

rocknbil

6:08 pm on Jan 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well I would remove the white space around all your quotes but that's not the problem.

Netscape acts funny sometimes with empty cells (I know, it's contradictory because it's working in the first one)

<TR><TD HEIGHT=1 BGCOLOR='BLACK'></TD></TR>

this

<TR><TD HEIGHT=1 BGCOLOR='BLACK'> &nbsp; </TD></TR>

Of course makes the bar too tall, so

<TR><TD HEIGHT=1 BGCOLOR='BLACK'><img src="spacer.gif" width="8" height="1" border="0" alt=""></TD></TR>

fixes it.

Also, these "stack" in NN 4.7 even with a nowrap (I know for a fact many are still using 4.7, in fact some areas of Qwest's site are inaccessable with anything else) instead of the side-by-side you're shooting for, so this is suggested:

....
<td>
<TABLE STYLE='display:inline' CELLPADDING=0 CELLSPACING=0>
<TR><TD HEIGHT=20>1</TD></TR>
<TR><TD HEIGHT=1 BGCOLOR='BLACK'><img src="spacer.gif" width="8" height="1" border="0" alt=""></TD></TR>
<TR><TD HEIGHT=20>4</TD></TR>
</TABLE>
</td>
<td>

<TABLE STYLE='display:inline' CELLPADDING=0 CELLSPACING=0>
<TR><TD HEIGHT=20>1</TD></TR>
<TR><TD HEIGHT=1 BGCOLOR='BLACK'><img src="spacer.gif" width="8" height="1" border="0" alt=""></TD></TR>
<TR><TD HEIGHT=20>4</TD></TR>
</TABLE>
</td> ....

Putting the nests inside two cells will lock them side by side.

Seems like a long way to go for fractions . . . .

rocknbil

3:21 am on Jan 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



white space around all your quotes

Sorry, I was laying on my desk. Equal signs. :-)

geeky_girl

8:17 am on Jan 9, 2005 (gmt 0)

10+ Year Member



Thanks everyone for your replies. You are all very kind.

Rocknbil, your suggestion actually worked well. I've been spending the last day trying to work with it. However, here's the wildcard: I need to be able to generate these kinds of fractions on the fly using general code, and I won't know in advance how wide to make the fraction bar. For instance, a width of 8 might not be enough if the numerator is something like 1 + x.

Is there a way to figure out how wide the cells will be in a certain table, before I write it out? If not, then I fear I'll be back to square one...

rocknbil

6:30 pm on Jan 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I was afraid of that. :D I'd resolve the fraction in a different way, other than tables. You can't use HTML entities, and need to use num-over-bar-over-num?

How about

topnum { text-decoration:underline; }
div.frac { text-align:center; }

<div class="frac">
<span class="topnum">1</span><br>
3
</div>

?

Not a great solution either but you can see where it's leading.