help! cell padding inconsistency- Firefox vs. IE7

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Koelner
    New Member
    • Aug 2007
    • 2

    help! cell padding inconsistency- Firefox vs. IE7

    Hello all,
    am very frustrated because I can't get a simple table to display the same way in both browsers. It displays the way I want it to in Firefox but not in IE7 (Windows XP).

    1) not sure if my doctype is correct- this is just a plain vanilla html page, so I used
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

    <html lang="en">

    2) I have tried to put cell padding=0, margin=0 on the table and the table cells in both the style sheet and the html document. No combination has worked so that IE7 will display the table row without the slight padding at the bottom of the row.

    I have added a border so that you can clearly see that the bottom of the rounded red corners do not touch the bottom of the row.

    I've even set the width and height of the table cells to those of the graphic but no luck. (I've checked the graphic, there is no white border around it).

    3) I can't get the center td's contents (a 1px by 1px graphic that I've stretched to 300 px) to align to the top in IE7.

    Any help is appreciated, thank you!

    Here's the page ...

    Here is my html page's code:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    
    <html lang="en">
    <head>
    <title>Foreclosure Prevention USA home page
    </title>
    
    <style>
    h1 {color: #ff0000; font-size: 26px; font-family: arial;}
    
    
    table {
    border-collapse: collapse; 
    padding: 0px;
    margin: 0px;
    }
    
    tr {
    padding: 0px;
    margin: 0px;
    }
    
    td {
      padding: 0px;
      margin: 0px;
      }
    
    td.cellTopAlign {vertical-align: top;}
    td.cellBottomAlign {vertical-align: bottom;}
    
    </style>
    
    </head>
    
    
    <body>
    <h1>Foreclosure Prevention USA home page
    </h1>
    
    <table border="1" cellpadding="0" cellspacing="0">
    <tr height="65px">
    <td class="cellTopAlign"><img src="top_left_rounded_corner.jpg" width="65px" height="65px"/>
    </td>
    <td class="cellTopAlign"><img src="pixel.jpg" width="300px" height="1px"/>
    </td>
    <td class="cellTopAlign"><img src="top_right_rounded_corner.jpg"width="65px" height="65px"/>
    </td>
    </tr>
    
    
    </table>
    </body>
    </html>
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    Your doctype is fine. All new pages should always use the strict doctype.
    But you should never use tables for layout.

    Validate for your list of 31 html errors. The 'alt' errors can be ignored for now.

    Another problem you'll have is with that geocities page. The garbage they put at the top will throw IE into quirks mode. That's not the problem with your table right now, though.

    Comment

    • Koelner
      New Member
      • Aug 2007
      • 2

      #3
      Hello drhowarddrfine!

      You are absolutely right- I scrolled through the 31 errors and almost all of them are from garbage code that geocities inserted.

      The only reason I ftp'd the page out to geocities is because I do not yet have a web hosting service. I just needed a way for you guys to be able to look at this page.

      If you copy and paste my code into an html document and view it locally on your computer, I'd be curious how it looks for you. I found that when looking at it on Geocities in Firefox, the table displays the way I intend (graphics are all lined up, and no white space at the bottom of the rounded red corners). If I open the html page locally on my computer, it doesn't even display properly in Firefox, let alone IE7.

      You recommend that I don't use tables for layout, but I'm just not sure what's the most efficient way to set up a containing "box" like this which will hold text. Should I make the entire box as a graphic and use layers to position text inside of it?

      Thanks!


      Originally posted by drhowarddrfine
      Your doctype is fine. All new pages should always use the strict doctype.
      But you should never use tables for layout.

      Validate for your list of 31 html errors. The 'alt' errors can be ignored for now.

      Another problem you'll have is with that geocities page. The garbage they put at the top will throw IE into quirks mode. That's not the problem with your table right now, though.

      Comment

      • drhowarddrfine
        Recognized Expert Expert
        • Sep 2006
        • 7434

        #4
        You recommend that I don't use tables for layout, but I'm just not sure what's the most efficient way to set up a containing "box" like this which will hold text.
        Heading to the ball game. Threw this together. I'll be back.
        Code:
        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
        
        <html lang="en">
        <head>
        <title>Foreclosure Prevention USA home page
        </title>
        
        <style type="text/css">
        *{margin:0;padding:0} 
        h1 {color: #ff0000; font-size: 26px; font-family: arial;}
        
        #left{
        	width:65px;
        	 height:65px;
        
        }
        #middle{
        	width:65px; height:1px; vertical-align:top;
        }
        #right{
        	width:65px; height:65px
        }
        </style>
        
        </head>
        
        
        <body>
        <h1>Foreclosure Prevention USA home page
        </h1>
        
        <img id="left" src="top_left_rounded_corner.jpg">
        <img id="middle" src="pixel.jpg" >
        <img id="right" src="top_right_rounded_corner.jpg" >
        
        </body>
        </html>
        Last edited by eWish; Aug 28 '08, 12:47 AM. Reason: Fixed code tag

        Comment

        • Sunny1957
          New Member
          • Aug 2008
          • 6

          #5
          Hello Koelner,

          I think the solution for your problem you can find on my page
          [DELETED]

          Sunny1957
          Last edited by RedSon; Aug 27 '08, 08:06 PM. Reason: Link in German

          Comment

          • RedSon
            Recognized Expert Expert
            • Jan 2007
            • 4980

            #6
            Hi Sunny,

            This is an English only site. Please be sure to provide links to English language sites.

            Thanks!

            Comment

            • Sunny1957
              New Member
              • Aug 2008
              • 6

              #7
              Hello Redson,
              I'm very sorry for my link to my German page. I now have corrected it. The only German words are directory and file names. I hope this is for now ok.
              picture in a table without slight padding at the bottom of the row
              best regards
              Uwe

              Comment

              • RedSon
                Recognized Expert Expert
                • Jan 2007
                • 4980

                #8
                Originally posted by Sunny1957
                Hello Redson,
                I'm very sorry for my link to my German page. I now have corrected it. The only German words are directory and file names. I hope this is for now ok.
                picture in a table without slight padding at the bottom of the row
                best regards
                Uwe
                Thanks for the update!

                Nice description!

                Comment

                • David Laakso
                  Recognized Expert Contributor
                  • Aug 2008
                  • 397

                  #9
                  You did not ask how you might do the entire layout without using a table. This strikes me as strange, since you have no tabular data whatsoever. Nevertheless, it is your call. But, If your call might include the possibility of a ditching the 1990s table layout you are striving for in favor of producing a contemporary tableless CSS layout, let me know. I will try to help to help...

                  Comment

                  • Sunny1957
                    New Member
                    • Aug 2008
                    • 6

                    #10
                    Originally posted by David Laakso
                    You did not ask how
                    This is a misunderstood, because I wouldn't ask something. My post should be the solution for question 2)
                    Originally posted by Koelner
                    No combination has worked so that IE7 will display the table row without the slight padding at the bottom of the row.
                    of the thread opener Koelner. And also it should be the answer of question 3).
                    Originally posted by Koelner
                    I can't get the center td's contents (a 1px by 1px graphic that I've stretched to 300 px) to align to the top in IE7.
                    In both cases, all to do is: remove the eol before </TD>
                    Originally posted by David Laakso
                    you have no tabular data whatsoever.
                    That's not correct. Ok it's a very small table, only 1 cell, and the data is no text, only a picture.
                    If you open my page and the right "table" ( produced by sample code ) in example 1 is identical to the left "table" ( hard coded picture ) in example 2 then you do not use IE7.
                    Otherwise you use perhaps Firefox 3.0.1. Other browsers/versions not testet.

                    Comment

                    • David Laakso
                      Recognized Expert Contributor
                      • Aug 2008
                      • 397

                      #11
                      Sunny1957, my reply was pointed to (or rather, I should have made it clear that it was pointed to) the OP. I must admit that I never really looked at your page other than a very momentary and cursory glance (my bad). And simply was asking the OP if an alternative tabless solution was of interest. Nevertheless, thank you for the clarification, and valid suggestions you made in reference to resolving the OPs issues...

                      Comment

                      • David Laakso
                        Recognized Expert Contributor
                        • Aug 2008
                        • 397

                        #12
                        Koelner,
                        Thanks for your private message indicating you want to try a tableless layout.
                        No need to re-invent the wheel. How about starting with a base layout known to work cross-browser? This layout will do [1].

                        1/ delete the #extra division from the markup and CSS-- not needed for what you are doing.
                        2/ adjust the column widths to match your layout:
                        Code:
                        #container {width: 800px; border: 1px solid red/*add for test purpose*/;}
                        #navigation { width: 177px; }
                        #content {width: 623px;}
                        4/ And delete all these CSS selectors as they are not needed for your page:
                        Code:
                        a{display:block;color: #006;padding:10px}
                        div#header{position:relative}
                        div#header h1{height:80px;line-height:80px;margin:0;
                        padding-left:10px;background: #EEE;color: #79B30B}
                        div#header a{position:absolute;right:0;top:23px}
                        5/ And delete this line from the header in the markup:
                        Code:
                        <h1>Header</h1><a href="http://blog.html.it/layoutgala/layout34.zip">download this layout</a>
                        6/ Are you with me so far? If so, now add your title image in the header like this;
                        Code:
                        <div id="header">
                        <img src="http://geocities.com/l_friedrich/images/header.jpg" width="800" height="59" alt="Lisa Giacone" />
                        </div>
                        7/ Add a division called #rap immediately below the close </div> of the header, and immediately above <div id="wrapper">. It will enclose your 3 25px height images in it like this:
                        Code:
                        <div id="rap">
                        <img src="http://geocities.com/l_friedrich/images/graphic_design_menu_off.jpg" width="153" height="25" alt="Graphic Design" /> 
                        <img src="http://geocities.com/l_friedrich/images/translation_menu_off.jpg" width="188" height="25" alt="Translation Services" /> 
                        <img src="http://geocities.com/l_friedrich/images/header_menu_spacer.jpg" width="459" height="25" alt="" />
                        </div>
                        8/ Still with me?
                        Add these selectors to the CSS to make the 3 image in #rap adjacent to each other; and, to close the gaps left for font descenders:
                        Code:
                        #rap img {float: left;}
                        img {display: block;}
                        8/ Bear with me... we're almost there (provided I've not messed up).
                        The brown like color rounded corner image can be set as a background image on #container in the CSS-- positioned left and 84 px from the top (59px + 25px = 84px) like this-- use your image path, not mine..:
                        Code:
                        #container{background:  url(geo/left_vert_bar.jpg) no-repeat 0 84px; border: 1px solid red;width:800px;margin:0 auto;text-align: left;}
                        9/ Code to compliant browsers (Opera, Safari, & FF); with frequent check-backs to the IEs (IE/6 & IE/7).
                        10/ Confused? Bewildered? Stuck? Write the forum-- myself or someone else on the forum will be more than happy to lend a hand...

                        [1]
                        Two Column Fixed (number 34)
                        [2]
                        Helpful resources:
                        CSS 2.1 Specs
                        http://www.w3.org/TR/CSS21/
                        w3c markup and validation services
                        http://www.google.com/search?client=o pera&rls=en&q=w 3c&sourceid=ope ra&ie=utf-8&oe=utf-8
                        And our good friend Google is quite good at answering questions...

                        Comment

                        • Sunny1957
                          New Member
                          • Aug 2008
                          • 6

                          #13
                          Originally posted by David Laakso
                          Confused? Bewildered? Stuck?
                          Yes, I am! Is this really the answer to the original question
                          Originally posted by Koelner
                          help! cell padding inconsistency- Firefox vs. IE7
                          I think no. It's nice that Koelner wrote you a private message, but why do you answer here? In the guide you wrote
                          Originally posted by David Laakso
                          1/ delete the #extra division from
                          But I can't find where I have to do this! Neither on the original linked page, nor in this thread!

                          Comment

                          Working...