My code is at
http://jsfiddle.net/user1212/G86KE/4/
The problem is in gmail it leaves an extra white space between 2 tables inside the same cell.
I have tried
display:block
worked great for the gap problem between my body and footer, but it didn't do anything for my header; neither did the other fixes. I know this is an old thread, but in case anyone stumbles across it and the above didn't help, this did it for me:
Add style="line-height:1px; font-size:0.0em;"
to the <td>
tag which contains your header table.
You might have to try a couple of different tags to find the right one, but it's another solution to try.
Using style="display:block" in the image tag should work. Also, don't forget to add it to the spacer image if you're using that.
Besides adding display:block
to your img
also add cellpadding="0" cellspacing="0" border="0"
to your table
(important: do not forget applying this to your wrapping table
as well)
Cheers
Styling HTML mails is horrible.
A few tips:
border-spacing:0; /*this should fix the spacing problem*/
You need to apply this to all the tables you are using, so you should include it in a <style>
block at the top like so:
<head>
<style>
table {border-spacing: 0;}
</style>
</head>
(sorry for the bad formatting, somehow the code refused to show up properly on multiple lines)
Well, I noticed the header's and body's content are actually tables inside another cell. Why don't you try to separate the header and body and move them on their separated row?
Something like this:
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<!-- Header table -->
</td>
</tr>
<tr>
<td>
<!-- Body table -->
</td>
</tr>
</table>
Also, just a tip, don't use <center>
tag to center stuff. If you're inside a table cell, just use align="center"
. This, also, applies to the whole table, so in order to center a table, just set the align
property to center
.
simply add
table{
font-size:0em;
border-collapse: collapse;
}
it will solve your problem