Link to home
Start Free TrialLog in
Avatar of mtech
mtechFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Table background problem

I have just created a page in DW 2004 and was checking the site reports and found an error with the background attribute as follows:

      The background attribute of the TABLE tag is not supported. [Netscape Navigator 7.0]

The code is:

     <table width="800" border="0" align="center" cellpadding="0" cellspacing="0" background="images/Front_base.gif">

This rather suggests that a background image in a table is not supported in NN7 but ok in everythng else!

Is this the case? If so is there a way to do this without using this attribute?

thanks in advance
mtech
Avatar of humeniuk
humeniuk
Flag of Canada image

The proper way to do it is to use CSS positioning instead of table-based layouts.  This will give you much more flexibility in terms of placing background images (among many other things) AND will make it easier to create a standards-compliant, cross-browser compatible page.  Take a look at www.csszengarden.com for some examples.

As an aside, if you use a static width (table or otherwise) of 800px, your design will be too wide for users with 800x600 resolution and they're still the majority, I believe, or close to it.  At 800x600 resolution, you really have about 760x420 to work with.
Avatar of mtech

ASKER

Humeniuk

I seem to have lost my last posting: I am aware of the size issue but a client has insisted it is 800 wide - at least it is only one page and all the others are ok :-(

The page has two tables in it but one has to have this image as a background.

Would the following code work ok:

<table width="800" border="0" align="center" cellpadding="0" cellspacing="0" style="background-image:url('images/myfile.gif')">

It seems to display OK in IE 6 and Dreamweaver does not flag it up as a problem for NN7  but I don't have NN7 to test it on.

Thanks
mtech
ASKER CERTIFIED SOLUTION
Avatar of humeniuk
humeniuk
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mtech

ASKER

humeniuk

Thanks for that - the image is the same size as the table so it won't tile, which is good for me. Looks like I need to install NN7 on my work PC  - not putting it on mine ;-) just to make sure. Oh well, at least I am getting paid for it.

thanks
mtech
"image is the same size as the table so it won't tile, which is good for me"
I figured, but wanted to mention it just in case.

"at least I am getting paid for it"
I'd install it, too, if someone would pay me.  Any takers?

Anyway, thanks for the A.  If you run into any problems, post back here.