Hopefully a basic HTML/CSS question

Discussion in 'OT Technology' started by Epik High, May 9, 2005.

  1. Epik High

    Epik High OT Supporter

    Joined:
    Mar 12, 2004
    Messages:
    16,678
    Likes Received:
    13
    Location:
    San Francisco
    Please take a look at this example:

    http://www.w3schools.com/html/tryit.asp?filename=tryhtml_table_align

    How do I remove the white space around the table? If I set the tables to 100% there will still be white space. I am creating a webpage that uses tables and there is always whitespace on the outside of the tables. I am using HTML and CSS. Thanks!
     
  2. AVengeance

    AVengeance Active Member

    Joined:
    Aug 17, 2004
    Messages:
    22,615
    Likes Received:
    0
    Location:
    In my bunker Position:Hunkering
    It's not the table, it's outside that. It's the iFrame and the table cell it's encapsulated in.
    I opened the file in a seperate window, but then it didn't have my saved changes.

    one way to check for space and what's causing it is to set STYLE="background-color:{lightcolor}" for each of the elements. Set them all different (like body=lightblue, DIV=lightgreen, TABLE=yellow, etc.). Whatever background color you see is the element that's causing the whitespace.

    Setting CELLSPACING and CELLPADDING in a table also helps remove some space.
     
    Last edited: May 9, 2005
  3. MrMan

    MrMan New Member

    Joined:
    Jul 13, 2004
    Messages:
    308
    Likes Received:
    0
    in HTML:
    change
    <table width="400" border="1">
    to
    <table width="400" border="1" cellspacing="0">

    in CSS
    <table width="400" border="1" cellspacing="0">
    to
    <table width="400" border="1" style="border-collapse: collapse">
     

Share This Page