?
Solved

Table background problem

Posted on 2005-05-08
5
Medium Priority
?
187 Views
Last Modified: 2010-04-25
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
0
Comment
Question by:mtech
  • 3
  • 2
5 Comments
 
LVL 33

Expert Comment

by:humeniuk
ID: 13954665
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.
0
 
LVL 1

Author Comment

by:mtech
ID: 13954800
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
0
 
LVL 33

Accepted Solution

by:
humeniuk earned 500 total points
ID: 13954949
Clients want what clients want :)

The syntax you have should work in both IE and NN from what I understand.  I don't have NN7 either.  I tend to check for IE and Firefox and not worry about the rest.  I know I should check NN, Opera, etc., but I don't.. Shame on me.  

In other words, I have the same info as you:

<table width="800" border="0" align="center" cellpadding="0" cellspacing="0" background="images/Front_base.gif">
. . . will work in IE, but not in NN (which will display it as a background image in each table cell).  Incidentally, I tested this in Firefox and it worked fine there, as well.
(Example: www.humeniuk.com/ee21416626/example1.html)

Whereas the style option:
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0" style="background-image:url('images/myfile.gif')">
. . . will work in both IE and NN (and Firefox, which I tested).
(Example: www.humeniuk.com/ee21416626/example2.html)

So, I believe you have NN-friendly syntax there, but if you want to be 100% certain, you should install NN and check.  Alternatively, if anyone out there has NN handy, they can check the above examples with it and tell us what you see.

Also, working properly means that it will tile to fill the space if the table is wider than the image (as you can see in the examples), but you probably know that.
0
 
LVL 1

Author Comment

by:mtech
ID: 13955472
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
0
 
LVL 33

Expert Comment

by:humeniuk
ID: 13955481
"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.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses
Course of the Month16 days, 3 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question