Table style border- outlook 2010 adds an extra spa

2019-06-17 19:13发布

问题:

I created an HTML for email marketing. I placed a table, and applied a border around it:

<table border="0" cellspacing="0" cellpadding="0" style="border:1px solid #982676; margin:0 16px;">

For some reason I am getting 1 pixel extra white space inside when I test it in OUTLOOK 2010. I see it around images that are aligned to the top and to the left, and I see it around other cells that have a solid background color.

See image at this link:screenshot

The top triangle is an image in a cell by itself. The bottom rectangle is a cell with a background color. These were supposes to stick to the border. This is a recurring problem. Has anyone encountered this issue before?

回答1:

Campaign monitor has a really great solution on how to solve this type of problem. Simple add this style code to your table elements. The code below solved my problem (same as OP) on Outlook 2010

<table align="left" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;"> ... </table>

http://www.campaignmonitor.com/blog/post/3694/removing-spacing-from-around-tables-in-outlook-2007-and-2010

If that doesn't work, try this. http://www.emailonacid.com/blog/details/C13/removing_unwanted_spacing_or_gaps_between_tables_in_outlook_2007_2010



回答2:

I found this here: http://www.emailonacid.com/blog/details/C13/7_tips_and_tricks_regarding_margins_and_padding_in_html_emails

" Table element margins and padding in Outlook 2007 and 2010 can cause issues

If you add margin or padding properties to your TABLE element, it will add that same margin and padding to every nested TD in Outlook 2007 and 2010. Cellpadding and cellspacing attributes are safe but it's best to avoid CSS margins and padding within the containing TABLE element."

So I guess your margin on the table could be causing this.I m not sure.



回答3:

In case you haven't found a solution to this problem yet:

Make sure you set border="0" for those images within the table cells.



回答4:

Add border-collapse:collapse; to the table style.



回答5:

For borders of 1 and 3 pixel width, the right border has a 1 pixel space behind it. One solution for this (weird...) kind of problem is a "ghost table" behind the current table, with the width of the current table minus 1 and border of 1. For example:

<!--[if mso]><table border="1" width="699">
<tr style="display:none;"><td>&nbsp;</td></tr>
</table><![endif]-->

More details: https://responsive.email/blog/s/1025987_Extra-space-behind-border-in-Outlook.html

Good luck...



回答6:

I solved this problem going into the table properties section and then clicking on "Options". Once the options box appears, change the default cell margins for Left and Right to 0" and then click OK.