user3553691
user3553691

Reputation: 13

Space between table cells

I have completely got insane because of that thing. I tried everything I could, but nothing works.

Example

CSS

body
{
   margin-top:0;
   margin-bottom:0;
   margin-left:0;
   margin-right:0;
}
table.gh
{
   margin:0px auto 0px auto;
   background-color:#00ffff;
   width:700px;
   border-collapse:collapse;
   padding:0px 0px 0px 0px;
   border-spacing:0px 0px;
   text-align:center;
   vertical-align:top;
}
table.gg
{
   margin:0px auto 0px auto;
   background-color:#00ffff;
   width:700px;
   border-collapse:collapse;
   padding:0px 0px 0px 0px;
   border-spacing:0px 0px;
   text-align:center;
   vertical-align:top;
}

and HTML inside the body:

<table class="gh">
   <tr>
      <td>
         <table class="gg">
            <tr>
               <td><img src="http://www.astrofotos.info/var/resizes/casb/Eclipse-Austr%C3%A1lia-2012/IMG_5631.jpg?m=1352856326" border="0"></td>
            </tr>
         </table>
      </td>
   </tr>
</table>

Now... You see there is a little bit space between the image and the top of the page? How am I getting rid of it?

Upvotes: 0

Views: 87

Answers (1)

MightyPork
MightyPork

Reputation: 18861

The padding of the table cell is causing your trouble.

Add this little piece of code and it will work:

table.gh td {
    padding: 0;
}

Upvotes: 1

Related Questions