Forum Moderators: open

Message Too Old, No Replies

NS 4.7 table background image ...

How to get it to NOT repeat in each cell

         

Hawkgirl

9:08 pm on Aug 6, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here's my problem:

I have a table that has several cells. I would like to use a background image for the table.

Our most beloved NS 4.7 feels the need to repeat the background image in each cell.

How do I get it to NOT repeat the image in each cell but rather use it as the background for the whole table?

:) Thank you.

moonbiter

9:41 pm on Aug 6, 2002 (gmt 0)

10+ Year Member



AFAIK, you have to wrap the table in a layer and declare the background on the layer. Unfortunately, this doesn't work in any other browser.

When it comes to table elements, image backgrounds are horribly broken in Netscape 4.x. The only place they behave in that browser are in the body and layer elements.

You can't wrap the table in a div and get it to display the background (try it and you will see why).

So, to really get this to work you will need a solution that will provide a layer-based markup for NS 4.x and a regular markup for other browsers.

jamie

11:37 am on Aug 7, 2002 (gmt 0)

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



much simpler is to make background image in one table, then nest a second table in it with all your content with a spacer.gif (transparent gif) as the background. e.g.:

<table width="760" border="0" cellspacing="0" cellpadding="0" background="images/bg.gif">
<tr>
<td>
<table width="760" border="0" cellspacing="0" cellpadding="20" background="images/spacer.gif">
<tr>
<td width="273">

good luck (grrrr... netscape browsers ;-)

moonbiter

1:56 pm on Aug 7, 2002 (gmt 0)

10+ Year Member



Eh yeah. That too! ;)

I think I am constitutionally blind to nesting tables nowadays. Good call, jamie.

jquerin

3:56 pm on Aug 7, 2002 (gmt 0)



Jamie's post is exactly what I have done in the past, and it works perfectly each time I've used it. I have a transparent gif on everyone of my sites that I've developed, I use it for everything from this trick, to using it to push table cells and other content into the spot I want. Works very nicely to maintain table column widths, when a percentage sized table is desired but a pixel fixed column is not.

--
Joe

jamie

4:10 pm on Aug 7, 2002 (gmt 0)

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



"I use it for everything"

me too ;-)))))))

although in the days of IE dominance (93% of our users are IE5 and above) i am getting more adventurous with .css ;-)

here's a big up for heath robinson web design solutions!

tedster

5:54 pm on Aug 7, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Another solution is to use <td background="null">