SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Oct 2003
    Location
    United States
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Table Width Creating Horizontal Bar in Moz.

    I have a table at 100% and in Mozilla Firebird it creates a horizontal scrollbar. I know Mozilla translates the 100% literally and I was wondering if someone can tell me how to get a table to be 100% in Mozilla without the scrollbar. Thanks.
    Last edited by tmapm; Oct 18, 2003 at 08:29.

  2. #2
    011521 dbalsdon's Avatar
    Join Date
    Feb 2003
    Location
    North Of Scotland
    Posts
    444
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i think you need to make it 99.9%.
    Daniel Balsdon
    My Site

  3. #3
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    According to web standards, the "width" of an element is the *content* width - any borders or margins are added to the content width.

    If you set the width of a table to 100% of the page, and then add a 1 pixel border and a 3pixel margin, then the table (including border and margin) ends up at 100% + 8px, and you get a scrollbar.

    Older versions of IE get it wrong, and include the border/margin in the width. In many circumstances, newer versions of IE will behave just like the old ones. Mozilla (including firebird) gets it right.

    Short answer: adjust your table width, border and margins so that the TOTAL is 100%.

    [see also http://www.w3.org/TR/REC-CSS2/box.html#box-dimensions, and http://tantek.com/CSS/Examples/boxmodelhack.html ]

  4. #4
    SitePoint Addict
    Join Date
    Oct 2003
    Location
    United States
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks You helped me realized I accidentally had something at -1 from the right side.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •