DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Fix Table Width Weirdness In IE6

04.21.2005
| 17229 views |
  • submit to reddit
        If you have a table with rowspans and colspans, it's especially likely that IE6 will begin to ignore your width settings (even if they all add up to the right number) and create a monster table that spreads off into the distance. If your tables work perfectly in FF/Safari/etc, and in IE6 your content is positioned properly but the invisible elements of the table (visible only with borders on) extends to the side so that you get a horizontal scroll bar no matter what you do, you might want to try this drastic CSS tweak:

html {
    overflow-y: hidden;
}

If that doesn't work, try it in body:
body {
    overflow-y: hidden;
}

<disclaimer>Note that this is somewhat hackish, as a last resort if you *know* your tables are *fine* and IE6 is screwing up, and that overflow-x/y are IE6-only and not real CSS. </disclaimer>