HELP! Formatting Tables on IE vs Safari, Firefox

Discussion in 'Web Design and Development' started by sigamy, Jan 13, 2007.

  1. sigamy macrumors 65816

    Joined:
    Mar 7, 2003
    Location:
    NJ USA
    #1
    I need some help. I am pulling text from a MySQL database and displaying the text in a table. The text can be large. In Safari and Firefox it looks great, the text goes to the end of the table (or table cell) and then wraps to the next line.

    In IE, it looks terrible. The text wraps way too soon.

    I've tried a bunch of things but I can't fix it in IE. Can any one help?

    Here it is. If you look at the text saying "Rebecca seems to have it all..."
     
  2. Makosuke macrumors 603

    Joined:
    Aug 15, 2001
    Location:
    The Cool Part of CA, USA
    #2
    First off, here's your problem:

    At the start of the "content" table, where you've got a comment "<!-- Top Download Start Here-->", you've got the immediately prior TD tag with its width set to 136 for some reason. (<td width="136" valign="top" bgcolor="#726C4B">)

    IE is honoring this, and so everything subsequent is being forced down to 136 pixels wide, or, as is the case with your screwy text wrapping, 136 pixels plus enough space to accomodate the longest word in the paragraph.

    Remove that width declaration, and the whole thing immediately looks ok in IE6.


    Now that I've answered your question, I have the right to rant a wee bit.

    To be honest, that's not your REAL problem here; your real problem is that you've got an absolutely Byzantine series of nested tables, and it's nearly impossible to figure out what's going on with that many tables-within-tables.

    You've probably heard people chanting about table-less CSS layouts, and I'm not going to lecture on that, but that's some ugly stuff so it's hardly surprising that it broke at some point.

    You may also have some kind of issue going on with extra and/or unclosed tables that don't even need to be there, but frankly it's such a mess I can't tell.

    And at least cursory validation really helps to pin down issues, because you can at least tell if everything is properly nested and closed that way. I don't mean escaping every & in a URL, but just the really obvious stuff would be nice--with 170 errors on validation it's too much to even try to figure out what is or isn't properly closed and might be causing a problem.

    Further, what's the point of declaring the doctype as XHTML transitional when it's not even close to valid? Might as well go with HTML4 loose so it's closer to what you're actually writing; that at least knocks 100 validation errors off the list...
     
  3. sigamy thread starter macrumors 65816

    Joined:
    Mar 7, 2003
    Location:
    NJ USA
    #3
    Thanks so much for the help. I really apprieciate it.

    I purchased this site from someone who had it developed by $5/hr overseas coders. I know enough to muck around but I'm not a CSS or PHP guru at all (as you can tell from this question).

    Those width settings were up in the main page--I wasn't even looking there. I was looking in a function that gets the top 5 from the DB and then creates all those nested tables.

    Maybe some day I'll look to clean it up. If you are interested PM me so I have your contact info.
     

Share This Page