i am trying to set a global font in an email. The Mail is built using tables to keep compatibility but there is one table that just does not accept my styles. What I have done:
{literal}
<style>
*,table, div, p, td, tr, #tabledetails, .tabledetails {
margin: 0;
font-family: Verdana, Arial, Helvetica, sans-serif !important;
color: #000000;
font-size: 12px;
}
</style>
{/literal}
...
<table id="tabledetails" class="tabledetails" width="100%" border="0" cellspacing="0" cellpadding="4" style="font-family: Verdana, Arial, Helvetica, sans-serif !important; font-size: 12px !important;">...
<td class="left" style="font-family: Verdana, Arial, Helvetica, sans-serif !important; font-size: 12px !important;">{$order_values.products_quantity} x</td>
So as you see I tried about everything i could to set the font (and not use Times New Roman like Outlook loves to do) but it still doesnt work. What else can i possibly do?
---- edit ----- complete email ----
<link href="{$_system_mail_css}" type="text/css" rel="stylesheet">
{literal}
<style>
*,table, div, p, td, tr, #tabledetails, .tabledetails {
margin: 0;
font-family: Verdana, Arial, Helvetica, sans-serif !important;
color: #000000;
font-size: 12px;
}
</style>
{/literal}
<table cellpadding="0" cellspacing="0" class="email_container" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; text-align: justify;">
<tr>
<td colspan="3" class="email_toplogo">
<div class="email_toplogo"><img src="{$_system_logo_url}" /></div>
</td>
</tr>
<tr>
<td class="email_table_left_bg" valign="top">
<div class="email_table_left"></div>
</td>
<td class="email_table_center_bg" valign="top">
<div class="email_content">
<h1>Hallo {$order_data.delivery_firstname} {$order_data.delivery_lastname},</h1>
<p>vielen Dank für Ihre Bestellung im Onlineshop von super cool company name i shouldnt tell anyone ;).
Wir werden Ihre Bestellung schnellstmöglich ausführen. Sie bekommen bei jeder Statusänderung Ihrer Bestellung eine automatisch generierte Email.</p>
<hr>
<P>Nachfolgend finden Sie Ihre Bestelldetails zur Kontrolle:</p>
<p>{txt key=TEXT_ORDER_NUMBER}: {$order_data.orders_id}</p>
<p>{txt key=TEXT_ORDER_DATE}: {$order_data.date_purchased}</p>
<p>E-Mail: {$order_data.customers_email_address}</p>
<table cellpadding="0" cellspacing="0" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;">
<tr>
<td style="width: 250px;">
<div class="shippingaddress">
<h2>{txt key=TEXT_SHIPPING_ADDRESS}</h2>
<p>{if $order_data.delivery_company}
{$order_data.delivery_company}<br />
{/if} {$order_data.delivery_firstname} {$order_data.delivery_lastname}<br />
{$order_data.delivery_street_address}<br />
{if $order_data.delivery_suburb} {$order_data.delivery_suburb}<br />
{/if} {$order_data.delivery_postcode} {$order_data.delivery_city}<br />
{if $order_data.delivery_state}{$order_data.delivery_state}
{/if}{$order_data.delivery_country}<br />
</p>
</div>
</td>
<td>
<div class="paymentaddress">
<h2>{txt key=TEXT_PAYMENT_ADDRESS}</h2>
<p>{if $order_data.billing_company} {$order_data.billing_company}<br />
{/if} {$order_data.billing_firstname} {$order_data.billing_lastname}<br />
{$order_data.billing_street_address}<br />
{if $order_data.billing_suburb} {$order_data.billing_suburb}<br />
{/if} {$order_data.billing_postcode} {$order_data.billing_city}<br />
{if $order_data.billing_state}{$order_data.billing_state}
{/if}{$order_data.billing_country}<br />
</p>
</div>
</td>
</tr>
</table>
{if $payment_info}<hr><h2>{txt key=TEXT_PAYMENT_INFOS}</h2>
<p>{$payment_info}</p>{/if}
<hr>
<table id="tabledetails" class="tabledetails" width="100%" border="0" cellspacing="0" cellpadding="4" style="font-family: Verdana, Arial, Helvetica, sans-serif !important; font-size: 12px !important;">
<tr class="headerrow">
<td class="left">{txt key=TEXT_QTY}</td>
<td class="left">{txt key=TEXT_ARTICLE}</td>
<td class="left">{txt key=TEXT_PRODUCTS_MODEL}</td>
<td class="right">{txt key=TEXT_SINGLE_PRICE}</td>
<td class="right">{txt key=TEXT_TOTAL_PRICE}</td>
</tr>
{foreach name=aussen item=order_values from=$order_products}
<tr class="{cycle values="contentrow1,contentrow2"}">
<td class="left" style="font-family: Verdana, Arial, Helvetica, sans-serif !important; font-size: 12px !important;">{$order_values.products_quantity} x</td>
<td class="left" style="font-family: Verdana, Arial, Helvetica, sans-serif !important; font-size: 12px !important;">{$order_values.products_name}</strong></td>
<td class="left" style="font-family: Verdana, Arial, Helvetica, sans-serif !important; font-size: 12px !important;">{$order_values.products_model}</td>
<td class="right" style="font-family: Verdana, Arial, Helvetica, sans-serif !important; font-size: 12px !important;">{$order_values.products_price.formated}</td>
<td class="right" style="font-family: Verdana, Arial, Helvetica, sans-serif !important; font-size: 12px !important;">{$order_values.products_final_price.formated}</td>
</tr>
{$order_values.products_information.html_content}
{/foreach}
<tr>
<td colspan="5" align="right" class="subtotal">
<div align="right">
<p>{txt key=TEXT_SUB_TOTAL}: {$total.product_total.formated}</p>
{foreach name=aussen item=order_total_values from=$order_total_data}
<p>{$order_total_values.orders_total_name}:
{$order_total_values.orders_total_price.formated}</p>
{/foreach} {foreach name=aussen item=tax_data from=$total.total_tax}
<p>{txt key=TEXT_TAX} {$tax_data.tax_key}%:
{$tax_data.tax_value.formated}</p>
{/foreach}
<p><span class="doubleline">{txt key=TEXT_TOTAL}: {$total.total.formated}</span></p>
</div>
</tr>
</table>
</div>
<hr>
<div class="email_footer">{$_system_footer_html}</div>
</td>
<td class="email_table_right_bg" valign="top">
<div class="email_table_right"></div>
</td>
</tr>
</table>
---- edit 2 ---- the produced code for the product listing part
<table id="tabledetails" class="tabledetails" width="100%" border="0" cellspacing="0" cellpadding="4" style="font-family: Verdana, Arial, Helvetica, sans-serif !important; font-size: 12px !important;">
<tr class="headerrow">
<td class="left">Anzahl</td>
<td class="left">Artikel</td>
<td class="left">Art.Nr.</td>
<td class="right">Einzelpreis</td>
<td class="right">Gesamtpreis</td>
</tr>
<tr class="contentrow1">
<td class="left" style="font-family: Verdana, Arial, Helvetica, sans-serif !important; font-size: 12px !important;">1.00 x</td>
<td class="left" style="font-family: Verdana, Arial, Helvetica, sans-serif !important; font-size: 12px !important;">Mavic Rennradschuh Zxellium 2011 black / white / yellow mavic</strong></td>
<td class="left" style="font-family: Verdana, Arial, Helvetica, sans-serif !important; font-size: 12px !important;">14207</td>
<td class="right" style="font-family: Verdana, Arial, Helvetica, sans-serif !important; font-size: 12px !important;"><span class="price"> 220,00 EUR</span></td>
<td class="right" style="font-family: Verdana, Arial, Helvetica, sans-serif !important; font-size: 12px !important;"><span class="price"> 220,00 EUR</span></td>
</tr>
<tr class="contentrow1"> <td class="right" valign="top"></td> <td class="left" valign="top"> <h3> Schuhgröße: </h3> </td> <td class="right" valign="top"></td> <td class="right" valign="top"></td> <td class="right" valign="top"></td> </tr> <tr class="contentrow1"> <td class="right" valign="top"></td> <td class="left" valign="top"> 42 </td> <td class="right" valign="top"> </td> <td class="right" valign="top"> </td> <td class="right" valign="top"> </td> </tr>
<tr>
<td colspan="5" align="right" class="subtotal">
<div align="right">
<p>Zwischensumme: <span class="price"> 220,00 EUR</span></p>
<p>Nachnahme:
<span class="price"> 3,60 EUR</span></p>
<p>DHL - versichert:
<span class="price"> 0,00 EUR</span></p>
<p>inkl. MwSt. 19%:
<span class="price"> 35,70 EUR</span></p>
<p><span class="doubleline">Gesamtsumme: <span class="price"> 223,60 EUR</span></span></p>
</div>
</tr>
</table>
Outlook is a pain in the a** when it comes to email rendering.
The only safe thing to do is add a style="font-family: Verdana, Arial, Helvetica, sans-serif;" to every paragraph and div. We all know it sucks - but tell this to Microsoft...
Only use inline styles on html emails. It will be stripped out in some email clients. Gmail is one example.
You'll need to add this to every td containing text.
style="font-family: Verdana, Arial, Helvetica, sans-serif;"
As others have said, you need to flatten the style classes into inline styles on all the objects.
I had a similar problem and wrote a C# function to flatten the styles into the HTML.
Flatten CSS into HTML using C# w/ MVC
Related
I have a custom HTML signature I am working on but am struggling to make it look consistent and correct across the majority of email clients. The CSS is all inlined and I am following the Email CSS standards accurately as far as I can tell.
The main problem occurring is that between different email clients (Gmail, iOS Mail, etc) the text color changes to black sometimes, and is not consistently the blue that I have set it to, and the vertical alignment of the text in relation to the image shifts and is inconsistent. Also, I cannot consistently get the text-decoration on the link to go away. Code with identifying information removed is below.
HTML before inlining
<head>
<meta charset="utf-8" />
<style>
* {
font-style: normal;
font-stretch: normal;
line-height: 17px;
letter-spacing: normal;
font-family: Avenir, Arial, sans-serif;
font-size: 14px;
border-collapse: collapse;
color: #000157 !important;
text-decoration: none !important;
}
.table-wrapper {
padding-top: 10px;
padding-left: 10px;
}
.personal-image-wrapper {
vertical-align: center;
}
.info-wrapper {
padding-left: 15px;
}
.info-name {
font-size: 16px;
font-weight: bold;
}
</style>
</head>
<body>
<table>
<tr>
<td class="table-wrapper">
<table>
<tr>
<td class="personal-image-wrapper">
<a href="https://www.google.com/" target="_blank">
<img width="150px" height="65px" class="personal-image" src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Black.png/440px-Black.png" />
</a>
</td>
<td class="info-wrapper">
<table>
<tr>
<td class="info-name">First Last</td>
</tr>
<tr>
<td class="info-profession">Job Description</td>
</tr>
<tr>
<td class="info-website">
website.com</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
HTML after inlining using https://putsmail.com/inliner
<!DOCTYPE html>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta charset="utf-8">
</head>
<body style="font-style:normal;font-stretch:normal;line-height:17px;letter-spacing:normal;font-family:Avenir, Arial, sans-serif;font-size:14px;border-collapse:collapse;color:#000157 !important;text-decoration:none !important;">
<table style="font-style:normal;font-stretch:normal;line-height:17px;letter-spacing:normal;font-family:Avenir, Arial, sans-serif;font-size:14px;border-collapse:collapse;color:#000157 !important;text-decoration:none !important;">
<tr style="font-style:normal;font-stretch:normal;line-height:17px;letter-spacing:normal;font-family:Avenir, Arial, sans-serif;font-size:14px;border-collapse:collapse;color:#000157 !important;text-decoration:none !important;">
<td class="table-wrapper" style="font-style:normal;font-stretch:normal;line-height:17px;letter-spacing:normal;font-family:Avenir, Arial, sans-serif;font-size:14px;border-collapse:collapse;padding-top:10px;padding-left:10px;color:#000157 !important;text-decoration:none !important;">
<table style="font-style:normal;font-stretch:normal;line-height:17px;letter-spacing:normal;font-family:Avenir, Arial, sans-serif;font-size:14px;border-collapse:collapse;color:#000157 !important;text-decoration:none !important;">
<tr style="font-style:normal;font-stretch:normal;line-height:17px;letter-spacing:normal;font-family:Avenir, Arial, sans-serif;font-size:14px;border-collapse:collapse;color:#000157 !important;text-decoration:none !important;">
<td class="personal-image-wrapper" style="font-style:normal;font-stretch:normal;line-height:17px;letter-spacing:normal;font-family:Avenir, Arial, sans-serif;font-size:14px;border-collapse:collapse;vertical-align:center;color:#000157 !important;text-decoration:none !important;">
<a href="https://www.google.com/" target="_blank" style="font-style:normal;font-stretch:normal;line-height:17px;letter-spacing:normal;font-family:Avenir, Arial, sans-serif;font-size:14px;border-collapse:collapse;color:#000157 !important;text-decoration:none !important;">
<img width="150px" height="65px" class="personal-image" src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Black.png/440px-Black.png" style="font-style:normal;font-stretch:normal;line-height:17px;letter-spacing:normal;font-family:Avenir, Arial, sans-serif;font-size:14px;border-collapse:collapse;color:#000157 !important;text-decoration:none !important;"/>
</a>
</td>
<td class="info-wrapper" style="font-style:normal;font-stretch:normal;line-height:17px;letter-spacing:normal;font-family:Avenir, Arial, sans-serif;font-size:14px;border-collapse:collapse;padding-left:15px;color:#000157 !important;text-decoration:none !important;">
<table style="font-style:normal;font-stretch:normal;line-height:17px;letter-spacing:normal;font-family:Avenir, Arial, sans-serif;font-size:14px;border-collapse:collapse;color:#000157 !important;text-decoration:none !important;">
<tr style="font-style:normal;font-stretch:normal;line-height:17px;letter-spacing:normal;font-family:Avenir, Arial, sans-serif;font-size:14px;border-collapse:collapse;color:#000157 !important;text-decoration:none !important;">
<td class="info-name" style="font-style:normal;font-stretch:normal;line-height:17px;letter-spacing:normal;font-family:Avenir, Arial, sans-serif;font-size:14px;border-collapse:collapse;font-size:16px;font-weight:bold;color:#000157 !important;text-decoration:none !important;">First Last</td>
</tr>
<tr style="font-style:normal;font-stretch:normal;line-height:17px;letter-spacing:normal;font-family:Avenir, Arial, sans-serif;font-size:14px;border-collapse:collapse;color:#000157 !important;text-decoration:none !important;">
<td class="info-profession" style="font-style:normal;font-stretch:normal;line-height:17px;letter-spacing:normal;font-family:Avenir, Arial, sans-serif;font-size:14px;border-collapse:collapse;color:#000157 !important;text-decoration:none !important;">Job Description</td>
</tr>
<tr style="font-style:normal;font-stretch:normal;line-height:17px;letter-spacing:normal;font-family:Avenir, Arial, sans-serif;font-size:14px;border-collapse:collapse;color:#000157 !important;text-decoration:none !important;">
<td class="info-website" style="font-style:normal;font-stretch:normal;line-height:17px;letter-spacing:normal;font-family:Avenir, Arial, sans-serif;font-size:14px;border-collapse:collapse;color:#000157 !important;text-decoration:none !important;">
website.com
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
Could you explain how you're testing your code and how you're setting up this code as an email signature? This might play a big role in the final results as what’s supported would ultimately be defined by the email client you're using to send your emails.
I see a few things that are known to cause problems in your code already:
The lack of reset attributes in your <table> tags make your tables styles subject to clients default styles. Add border="0" cellpadding="0" cellspacing="0" role="presentation" for more consistent rendering.
width="150px" height="65px" on the <img> must be defined without units or the Outlooks on Windows will ignore it. So make that width="150" height="65".
Inline !important declarations are not supported by the Outlooks on Windows.
Overall, your code could also be made a whole lot simpler by using a single table and more semantic elements. Here’s a suggestion of code you could use:
<table border="0" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td style="padding:10px; vertical-align:middle;"><a href="https://www.example.com" target="_blank"><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Black.png/440px-Black.png" alt="" border="0" width="150" height="65" style="vertical-align:middle; color:#000157; font:14px/17px Avenir, sans-serif; background:#eee;" /></td>
<td style="padding:10px 5px; vertical-align:middle;">
<p style="margin:0; color:#000157; font:bold 16px/19px Avenir, sans-serif; text-align:left;">
First Last
</p>
<p style="margin:0; color:#000157; font:14px/19px Avenir, sans-serif; text-align:left;">
Job Description
</p>
<p style="margin:0; color:#000157; font:14px/19px Avenir, sans-serif; text-align:left;">
example.com
</p>
</td>
</tr>
</table>
This question already has an answer here:
Wrong display of html e-mail in Outlook
(1 answer)
Closed 4 years ago.
I'm trying to create a html based email signature with tables.
It's definitely working in html, works when I copy and paste into gmail, however when I copy into Outlook, the CSS break. Did I do something wrong here?
<table style="width: 500px; font-size: 12pt; font-family: Arial,sans-serif; line-height:normal;" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="width:86px; vertical-align:middle;" valign="middle">
<img border="0" alt="Logo" height="auto" width="148" style="width:148px; height:auto; border:0;" src="https://i.imgur.com/1HlZfl8.png">
</td>
<td style="width:45px; text-align:center; vertical-align:middle;" valign="middle">
<div style="margin-left:15px"><img src="https://i.imgur.com/mNNR1Ga.png"></div>
</td>
<td style="width:500px; vertical-align:middle;" valign="middle">
<table cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="font-size:12pt; font-family: Arial, sans-serif; color: #3d3c3f; padding-bottom:3px;"><span style="font-weight: bold; font-family: Arial, sans-serif; color:#3c3c3b;">Jessica Smith</span>
<span style="font-size:9pt; font-family: Arial, sans-serif; color:#3c3c3b;"> | CEO/Founder</span></td>
</tr>
<tr>
<td style="font-size:9pt; font-family: Arial, sans-serif; color: #9b9b9b; padding-bottom:1px;"><span style="font-family: Arial, sans-serif; color:#3c3c3b;"><div style="font-weight:bold; display: inline-block; width: 15px;">t </div>(07) 3281 0000</span><span style="font-family: Arial, sans-serif; color:#3c3c3b"></span><span style="font-family: Arial, sans-serif; color:#3c3c3b; margin-left:10px;"><div style="font-weight:bold; display: inline-block; width: 15px;">f</div>(07) 3281 0000</span>
</td>
</tr>
<tr>
<td width="20px" style="font-size:9pt; font-family: Arial, sans-serif; color: #9b9b9b; padding-bottom:1px;"><span style="font-family: Arial, sans-serif; color:#3c3c3b; "><div style="font-weight:bold; display: inline-block; width: 15px;">e </div>info#domainnamehere.com.au</span>
</td>
</tr>
<tr>
<td style="font-size:9pt; font-family: Arial, sans-serif; color: #9b9b9b; padding-bottom:1px;"><span style="font-family: Arial, sans-serif; color:#3c3c3b;"><div style="font-weight:bold; display: inline-block; width: 15px;">w </div>domainnamehere.com.au</span>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td style="width:500px; padding-top:16px;" colspan="3" width="500">
<img border="0" alt="Banner" width="500" style="width:500px; height:auto; border:0;" src="https://i.imgur.com/NBxWjRC.png">
</td>
</tr>
</tbody>
</table>
Gmail Screenshot
Outlook Screenshot
Not sure what's going on.
Email clients does not strictly follow HTML Standards. The viewing technology of a typical email client isn't as up-to-date as a web browser. You need to be careful about that. HTML code works in your browser may not work on Email Clients.
You may want to read Mailchimps Article and visit this link for the CSS Support
I'm trying to have an image and text in the same vertical align (Info numbers and mail) but is not working.
I've tried line-height of 22px and vertical-align in the td but is not working and
I'm feeling clueless now!
<table width="500">
<tbody>
<tr>
<td style="font-family: Helvetica, arial, sans-serif; font-size: 11px;color: #4C4D4D;line-height:22px;vertical-align:middle;"><p><img src="img/Phone-Ico.png" width="22" height="22" alt="">+57 (1) 7026202</p></td>
<td style="font-family: Helvetica, arial, sans-serif; font-size: 11px;color: #4C4D4D;line-height:22px;vertical-align:middle;"><p><img src="img/Whatsapp-Ico.png" width="22" height="22" alt="">+57 (1) 7026202</p></td>
<td style="font-family: Helvetica, arial, sans-serif; font-size: 11px;color: #4C4D4D;line-height:22px;vertical-align:middle;"><p><img src="img/Mail-Ico.png" width="22" height="22" alt="">banano#adsmovil.com</p></td>
<td style="font-family: Helvetica, arial, sans-serif; font-size: 11px;color: #4C4D4D;line-height:22px;vertical-align:middle;"><p><img src="img/Skype-Ico.png" width="22" height="22" alt="">banano2000</p></td>
</tr>
<tr>
<td>
<p style="font-family: Helvetica, arial, sans-serif; font-size: 11px;color: #4C4D4D;"> Bogotá, Colombia </p></td></tr>
</tbody>
</table>
Here's how it looks right now.
Set the vertical-align property of your images to either middle or bottom.
For example:
a img {
vertical-align: middle;
}
I am building a email signatures and have trouble on Android. Everywhere works fine, but in Android email client i have big spaces between table rows. I send signature from MS Outlook 2013 and Outlook add to code own span's:
<span style=3D'font-size:12.0pt;font-family:"Times New =Roman","serif"'> <o:p></o:p></span>
I don't know what's that but 99% it's a reason of troubles.
Original code looks like this:
<tr>
<td width="40px"></td>
<td width="20">
<span style="font-family: Arial, sans-serif; font-size: 11px; line-height: 16px; font-weight: bold;color: #004e7c;">
W
</span>
</td>
<td width="260px" >
<span style="font-family: Arial, sans-serif; font-size: 11px; line-height: 16px; font-weight: regular; font-style: italic; color: #004e7c;">
example.com
</span>
</td>
</tr>
When I send email from Mailchimp, everything is good and code looks like this (classes form head included to html)
<tr style="font-family: Arial, sans-serif;color: #004e7c; margin: 0;padding: 0;">
<td width="40px" style="font-family: Arial, sans-serif;color: #004e7c;padding: 2px 0;margin: 0;"></td>
<td width="20px" style="font-family: Arial, sans-serif;color: #004e7c;padding: 2px 0;margin: 0;">
<span style="font-family: Arial, sans-serif;font-size: 11px;line-height: 16px;font-weight: bold;color: #004e7c;">
W
</span>
</td>
<td width="260px" style="font-family: Arial, sans-serif;color: #004e7c;padding: 2px 0;margin: 0;">
<span style="font-family: Arial, sans-serif;font-size: 11px;line-height: 16px;font-weight: regular;font-style: italic;color: #004e7c;">
example.com
</span>
</td>
</tr>
But email form Outlook looks like this:
<tr><td =
style=3D'padding:1.5pt 0in 1.5pt 0in'></td><td width=3D20 =
style=3D'width:15.0pt;padding:1.5pt 0in 1.5pt 0in'><p =
class=3DMsoNormal><b><span =
style=3D'font-size:8.5pt;font-family:"Arial","sans-serif";color:#004E7C'>=
W</span></b><span style=3D'font-size:12.0pt;font-family:"Times New =
Roman","serif"'> <o:p></o:p></span></p></td><td style=3D'padding:1.5pt =
0in 1.5pt 0in'><p class=3DMsoNormal><i><span =
style=3D'font-size:8.5pt;font-family:"Arial","sans-serif";color:#004E7C'>=
<a href=3D"http://example.com/"><span =
style=3D'color:#004E7C'>example.com</span></a> </span></i><span =
style=3D'font-size:12.0pt;font-family:"Times New =
Roman","serif"'><o:p></o:p></span></p></td></tr>
There We have this <span>, what causes troubles. How i can eliminate this <span>?
Simple solution is to remove the span and place the styling into the TD tag. This is actually a more reliable way to style text anyway. (Also, when declaring the html width/height, you just do the number, you do not add the px.) It would also be a good idea to add a styling in the stylesheet that 0's the P tags padding and margin as Outlook likes to throw in P tags. E.g.
<style>
p {margin: 0; padding: 0; }
</style>
---------------------------
<tr style="font-family: Arial, sans-serif;color: #004e7c; margin: 0;padding: 0;">
<td width="40" style="font-family: Arial, sans-serif;color: #004e7c;padding: 2px 0;margin: 0;"></td>
<td width="20" style="font-family: Arial, sans-serif;color: #004e7c;padding: 2px 0;margin: 0; font-size: 11px;line-height: 16px;font-weight: bold;color: #004e7c;">W</td>
<td width="260" style="font-family: Arial, sans-serif;color: #004e7c;padding: 2px 0;margin: 0; font-size: 11px;line-height: 16px;font-weight: regular;font-style: italic;color: #004e7c;">example.com</td>
</tr>
So, I'm trying to make a email template with a table.
I have the following table right under the body tag
<table style="padding-top:0px; max-width: 650px;" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#ffffff">
<tbody>
<tr>
<td height="10" style="width: 650px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody width="100%">
<tr width="100%">
<td width="2.5%"> </td>
<td width="22%" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold;">AAAA AAAA</td>
<td width="40%" style="text-indent: 4%; font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold;">BBBB</td>
<td width="22%" align="center" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold;">CCC</td>
<td width="13%" style="text-indent: 4.5%; font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold;">DDDDD</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
And it looks just the way I want in Outlook (desktop, mobile portrait, mobile landscape). And it looks fine in gmail on the desktop and in mobile landscape.
But if you open it in gmail on mobile portrait, the td's are pretty bunched up on the left hand side.
Anyone know why? If it matters, I'm testing in the gmail app on a Nexus 5 phone.
Try this:
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="25%" style="padding-left:3%; font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold;">AAAA AAAA</td>
<td width="40%" style="padding-left: 4.5%; font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold;">BBBB</td>
<td width="22%" align="center" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold;">CCC</td>
<td width="13%" style="padding-left: 4.5%; font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold;">DDDDD</td>
</tr>
</table>
Not sure if text-indent works, but padding does. If you want a max-width fluid layout, wrap it inside this fluid template example