Solved

Internet Explorer table rendering - Browser Compatibility

Posted on 2006-06-08
5
377 Views
Last Modified: 2008-01-09
Hello,

I'm working on my personal site and it's becoming a headache. I created my Photoshop layout and saved it as an HTML file for porting to PHP. Unfortunately, the table renders differently in Firefox (my browser of choice) and in Internet Explorer. A sample of the problem pages can be found at: www.crimsondiva.com/design/.

In Firefox, the site looks fine. In IE, however, the navigation column shifts down so that the entire table is messed up. I've changed table widths and heights to no avail. I've attached the whole code (aside from javascript):

<BODY onLoad="preloadImages()" bgcolor="#000000" topmargin="0" bottommargin="0">
<!-- ImageReady Slices (DESIGN06.psd) -->
<TABLE align="center" width="850" border="0" cellpadding="0" cellspacing="0">
      <TR>
            <TD valign="top" colspan="4" height="58">
                  <IMG src="/design/DESIGN06_01.jpg" width="850" height="58" ></TD>
      </TR>
      <TR>
            <TD valign="top" rowspan="7" background="/design/leftsliver.gif" width="125">
                  <IMG src="/design/DESIGN06_02.jpg" width="155" height="511" >
            </TD>
            <TD valign="top" background="/design/middlesliver.gif" height="21" width="125">
                  <A href="/design/"      onMouseOver="window.status='home'; changeImages('home', 'nav_homeON.gif'); return true;" onMouseOut="window.status=''; changeImages('home', 'nav_home.gif'); return true;">
                  <IMG border="0" name="home" src="/design/nav_home.gif" width="125" height="21" ></A>
            </TD>
<TD valign="top" rowspan="7" background="/design/DESIGN06_04.gif">
<DIV class="pageheader">Welcome</DIV>
Whew! I've been pretty lately and didn't have time to update my site. Well, I finally took
some time to update it with a fresh new look! I hope you like it.
</TD>
            <TD valign="top" rowspan="6" background="/design/rightsliver.gif" height="207" width="165">
            <IMG src="/design/DESIGN06_05.jpg" width="165" height="207" >
            </TD>
      </TR>
      <TR>
            <TD valign="top" background="/design/middlesliver.gif" height="26" width="125">
                  <A href="/design/about.php" onMouseOver="window.status='about'; changeImages('about', 'nav_aboutON.gif'); return true;" onMouseOut="window.status=''; changeImages('about', 'nav_about.gif'); return true;">
                  <IMG border=0 name="about" src="/design/nav_about.gif" width="125" height="26" ></A></TD>
      </TR>
      <TR>
            <TD valign="top" background="/design/middlesliver.gif" height="29" width="125">
                  <A href="/design/design.php" onMouseOver="window.status='design'; changeImages('design', 'nav_designON.gif'); return true;" onMouseOut="window.status=''; changeImages('design', 'nav_design.gif'); return true;">
                  <IMG border=0 name="design" src="/design/nav_design.gif" width="125" height="29" ></A></TD>
      </TR>
      <TR>
            <TD valign="top" background="/design/middlesliver.gif" height="21" width="125">
                  <A href="/design/resume.php" onMouseOver="window.status='resume'; changeImages('resume', 'nav_resumeON.gif'); return true;"      onMouseOut="window.status=''; changeImages('resume', 'nav_resume.gif'); return true;">
                  <IMG border=0 name="resume" src="/design/nav_resume.gif" width="125" height="21" ></A></TD>
      </TR>
      <TR>
            <TD valign="top" background="/design/middlesliver.gif" height="24" width="125">
                  <A href="/design/photos.php" onMouseOver="window.status='photos'; changeImages('photos', 'nav_photosON.gif'); return true;" onMouseOut="window.status=''; changeImages('photos', 'nav_photos.gif'); return true;">
                  <IMG border=0 name="photos" src="/design/nav_photos.gif" width="125" height="24" ></A>
            </TD>
       </TR>
      <TR>
            <TD valign="top" rowspan="2" background="/design/middlesliver.gif" height="390">
                  <IMG src="/design/DESIGN06_10.jpg" width="125" height="390" >
            </TD>
      </TR>
      
      <TR>
            <TD valign="top" background="/design/DESIGN06_11.gif" height="304" width="165">
            <DIV class="pageheader">Guest Book</DIV>
            Take a moment to sign my guest book!
                  </TD>
      </TR>
      <TR>
            <TD valign="top" colspan="4" height="31" width="850">
                  <IMG src="/design/DESIGN06_12.gif" width="850" height="31" ></TD>
      </TR>
</table>
</BODY>
</HTML>
0
Comment
Question by:crimsondiva
  • 3
  • 2
5 Comments
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 16866926
no wonder it gives you a headache...
html should be coded by hand with semantics in mind and separation between content and presentation.
the code generated by software is always ugly and impossible to maintain.

first, you should start by using a doctype:
http://www.htmlhelp.com/tools/validator/doctype.html

use the HTML4.01 strict:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

then use css-based layout (tables are for tabular data, not for layout).

and you should validate both your html and css:
http://validator.w3.org/
http://jigsaw.w3.org/css-validator/

good luck.
0
 

Author Comment

by:crimsondiva
ID: 16872119
GrandSchtroumpf,

Generally, I hand code everything. This code is created from ImageReady/Photoshop CS. I read your comments. I'm new to doctypes, however. I've considered using CSS for layouts, but I'm not sure where to start. Can you recommend some sites and/or books for this?

Diva
0
 
LVL 30

Accepted Solution

by:
GrandSchtroumpf earned 250 total points
ID: 16874779
I use the official w3c website (www.w3.org).  That's the best source you can get...

> but I'm not sure where to start.
That's a common problem...
I suggest you start by reading the WAI section (www.w3.org/WAI/) which explains all good practice rules in detail.
It will help you understand the basic principles of content/presentation separation.
I know it takes some time and the writing style is a little technical, but you get used to it, and it's definitely the best investment you can make if you want to build quality websites.

For real-life examples, a list apart (www.alistapart.com) is an excellent site.
0
 

Author Comment

by:crimsondiva
ID: 16886647
Thanks for all of your help. I will have to take the time to do this!
0
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 16887841
<:°)
Yes, it takes some time to learn, but at least when you do things properly there are less chances you'll need to redcode the whole site.
IE6 is a major problem for all web developers, even when using proper code, so, be ready to have to learn a few little tricks to force IE behave a little better...
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now