I put my main table at 100% width but there's still some white on the sides?

Discussion in 'HTML & Website Design' started by rbf738, Mar 8, 2009.

  1. #1
    I'm new to html design, so I'm putting together my first pages. I started with a table in which everything else would be encapsulated, so I set the 100% width yet when I change the backround color and view the page in my browser, there is still some white on the sides, so its clearly not taking up 100% of the page. How can I fix this?
     
    rbf738, Mar 8, 2009 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    29,002
    Likes Received:
    4,578
    Best Answers:
    124
    Trophy Points:
    665
    #2
    Your table probably has cellspacing or cellpadding at the default values or a value > 0
    but you should use a div rather than a table in most instances if you are trying to control your page.

    Can you post a link to your example?
     
    sarahk, Mar 8, 2009 IP
  3. mariusrec

    mariusrec Peon

    Messages:
    15
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    like sarahk said, it is recomended that you use a div rather than a table to control your page.

    anyway, if you still decide to use a table make sure all cellspacing and cellpadding are set to "0" and also you can create a stylesheet and add these lines

    body {
    padding:0px;
    margin:0px;
    background: black;
    }

    at the "background" you can place whichever color you like and that will be the background color on the entire page.
     
    mariusrec, Mar 9, 2009 IP
  4. wp-themes

    wp-themes Banned

    Messages:
    230
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Just change the body padding and margin to 0 as advised above by 'mariusrec' and property set the background color to a matched one ;)
     
    wp-themes, Mar 9, 2009 IP