Newb question - how to make a table span WHOLE page (without spaces on sides)

Discussion in 'HTML & Website Design' started by xyz, Jun 28, 2007.

  1. #1
    I have table width set to 100, but want it to span the full page....I want the red table to span from side to side, and right to the top with now white spacing in between.

    http://www.dealspot.ca/test/header.php

    Here is the code:
    <body>
    <table width="100%" border="0" cellspacing="0">
      
        <td height="48" bgcolor="#c83d1d"><div align="left" class="style1">dealspot.ca</div></td>
    
    </table>
    <table width="100%" border="0" cellspacing="0">
      <tr>
        <td><div align="center">other</div></td>
      </tr>
    </table>
    </body>
    Code (markup):
    any help is appreciated.

    thanks
     
    xyz, Jun 28, 2007 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    Add this to your stylesheet:
    
    html, body {
      margin: 0;
      padding: 0;
      }
    Code (markup):
    cheers,

    gary
     
    kk5st, Jun 28, 2007 IP
  3. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #3
    I'd also suggest:

    table {
    border-collapse:collapse;
    }

    not because it would get you the full screen width, but so you could axe the cellpadding, cellspacing and border declarations.

    You may also want to add TR's to that first table... and are you assigning more styling to those DIV's, or could you get rid of them and apply it to the TD's...

    I'm also assuming you aren't using the tables as only single td in your live copy? If you aren't, just use a div instead.
     
    deathshadow, Jun 29, 2007 IP