Outlook HTML Signature in GMail App: Gap between <td> Elements - android

I am facing a strange behavior of the GMail App on Android when displaying an HTML Signature created with Outlook 2017 from Mac OS.
First of all, here is what I did:
I created an HTML signature with a simple table layout and opened in a Browser
I copied the content from the Browser Window into the Signature Panel in Outlook (Outlook -> Settings -> Signature)
I kept the original formatting after pasting the content
Now the Signature basically looks fine in the Browser, Outlook on Mac and in the iPhone standard Mail App. In Gmail on Android there are very large gaps between the table rows and I cannot find any way to control them. Of course I dod some research and ended up with recommendations discussed here and here amongst many other sources. The formatting issues have been adressed in Google Forums. Some People were able to break it down to a specific CSS class MsoNormal added by Outlook, however they are all quite old and the suggestions do not seem to work out for me. I have tried a lot of stuff and ended up with three different versions all with the same or similar results.
The first version uses divs inside the table to structure the text:
<table style='font-family:Arial; cellspacing:0px; cellpadding:0px; padding:0px; margin:0px; border-spacing: 0; line-height:60%;'>
<tbody>
<tr>
<td>
<img src='http://361nutrition.de/signature/img/dummy.jpg' alt='line' style='width:85px; height:130px; display:block; vertical-align:text-top; line-height:0;' />
</td>
<td style='width:5px'></td>
<td style='vertical-align:top;'>
<div style='font-size: 11px; margin:0px; padding:0px;'>
Peter Pan<br>
Chief Executive Officer<br>
<b>The Company</b>
</div>
<div style='font-size: 9px; margin:0px; padding:0px;'>
Reach me at:<br>
peter#thecompany.com<br>
+00 324 244 20
</div>
<div style='font-size: 9px; margin:0px; padding:0px;'>
...or visit me at:<br>
My Office<br>
Office Street Nr.<br>
44556 Officetown
</div>
</td>
</tr>
</tbody>
</table>
The second uses a table within the table:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style type="text/css">
p.MsoNormal {
margin: 0px !important;
}
</style>
</head>
<body>
<table class='tbl' style='min-width:300px; font-family:Arial; cellspacing:0px; cellpadding:0px; padding:0px; margin:0px; border-spacing: 0; line-height:60%;'>
<tbody class='tbl_body'>
<tr class='tbl_tr' style="display: block; white-space: nowrap;">
<td class='tbl_td' style="line-height:0; display: inline-block;"><img src='http://361nutrition.de/signature/img/dummy.jpg' alt='line' style='width:85px; height:130px; display:block; vertical-align:text-top' /></td>
<!--<td style='width:5px; display: inline-block;'></td>-->
<td class='tbl_td' style='vertical-align:top; display: inline-block;'>
<table class='tbl' style='font-family:Arial; cellspacing:0px; cellpadding:0px; padding:0px; margin:0px; border-spacing: 0; line-height:60%;'>
<tbody class='tbl_body'>
<tr class='tbl_tr' style='font-size: 11px; margin:0px; padding:0px; display: block; white-space: nowrap;'>
<td class='tbl_td' style="display: inline-block;">Peter Pan<br>Chief Executive Officer<br><b>The Company</b></td>
</tr>
<tr class='tbl_tr' style='font-size: 11px; margin:0px; padding:0px; display: block; white-space: nowrap; '>
<td class='tbl_td' style="display: inline-block;">Reach me at:<br>peter#thecompany.com<br>+00 324 244 20</td>
</tr>
<tr class='tbl_tr' style='font-size: 11px; margin:0px; padding:0px; display: block; white-space: nowrap;'>
<td class='tbl_td' style="display: inline-block;">...or visit me at:<br>My Office<br>Office Street Nr.<br>44556 Officetown</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</body>
</html>
And finally I used a 3 x 2 table layout with the image spanning 3 rows:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style type="text/css">
p.MsoNormal {
margin: 0px !important;
}
</style>
</head>
<body>
<table style='font-family:Arial; cellspacing:0; cellpadding:0; border:0; border-collapse: collapse; padding:0px; margin:0px; border-spacing: 0; line-height:60%;'>
<tbody>
<tr style='margin:0px; padding:0px;'>
<td rowspan="3" style='line-height:0'>
<img src='http://361nutrition.de/signature/img/dummy.jpg' alt='line' style='width:85px; height:130px; display:block; vertical-align:text-top' />
</td>
<td style='font-size: 11px; margin:0px; padding:0px;'>Peter Pan<br>Chief Executive Officer<br><b>The Company</b></td>
</tr>
<tr style='margin:0px; padding:0px;'>
<td style='font-size: 11px; margin:0px; padding:0px;'>Reach me at:<br>peter#thecompany.com<br>+00 324 244 20</td>
</tr>
<tr style='margin:0px; padding:0px;'>
<td style='font-size: 11px; margin:0px; padding:0px;'>...or visit me at:<br>My Office<br>Office Street Nr.<br>44556 Officetown</td>
</tr>
</tbody>
</table>
</body>
In GMail the results for the table approaches look somewhat like this:
And the div approach somewhat like this:
As you can see there are large gaps between the text boxes, although there is no margin, padding, cellspacing or whatsoever.
I have fiddled around with CSS a lot and didn't come up with any solution.
I hope someone can help.
Regards,
Markus

First of all, did you try to use <meta name="viewport" content="width=device-width" /> in your head section ?
Then, did you also try to reduce the line-height of your <td>, or wrap all your informations in one <td> markup, and put some <br> break in it ?
Hope it's help.
Chaaampy.

Related

Table row on Android 6 is not taking 100% width

I have the code below used in an html email and it's working as expected in all email clients, except Android 6.0 Gmail! the blue contact us button is not taking 100% of the width.
Any thoughts?
First screenshot shows how it looks like on real device, while the second one is from litmus which is not correct, but this is what I'm trying to make look like.
The code:
.cta {
text-align: left;
vertical-align: middle;
}
#media only screen and (max-width:414px) {
.mobile {
width: 100% !important;
padding: 0 !important;
margin: 0 !important;
}
<table class="mobile" cellpadding="0" cellspacing="0" border="0" width="33%" align="right" style="font-family: Arial, Helvetica, sans-serif;">
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="background-color:#00a5c9; font-weight: normal;">
<tr>
<td class="cta" style="text-align: left; font-family: arial, sans-serif; color: #FFFFFF; font-weight: 700; padding: 10px; color: #FFFFFF; vertical-align: top; line-height: normal !important;">
<a style="text-align: left; font-family: arial, sans-serif; color: #FFFFFF; font-weight: 700; cursor: pointer;">CONTACT US</a>
</td>
<td style="text-align: left; color: #FFFFFF; font-weight: 700;"><img src="http://via.placeholder.com/25/0f0" /></td>
</tr>
</table>
</td>
</tr>
</table>
A good way around this is the force Android 5.1 & 6.0 to display the desktop version of your email. The code snippet below needs a 600x1 transparent png to act as a full width spacer. This spacer will be hidden on all mobile clients that support media queries and allow the mobile view to render.
<tr style="line-height: 1px; mso-line-height-rule: exactly;" class="mobilehide">
<td align="center" style="min-width:600px;font-size:1px; line-height: 1px; mso-line-height-rule: exactly;">
<img src="images/android-spacer.png" alt="" width="600" height="1" style="display: block;" border="0">
</td>
</tr>
This should be added before the closing tag of your outermost table (last one before the closing body)
</td>
</tr>
<!-- add here -->
</table>
</body>
</html>
Instead of using width: 100%;, try using width: 100vw;
Certain versions of Android and Gmail do not use media queries.
https://www.campaignmonitor.com/css/media-queries/media/
This is why the blue contact button only takes up 1/3 of the Android screen, but it takes up 100% of the screen on IOS devices. IOS will respect the media query and Android will use the width="33%" from the table:
<table class="mobile" cellpadding="0" cellspacing="0" border="0" width="33%" align="right" style="font-family: Arial, Helvetica, sans-serif;">
Since you will not post the rest of your code as expected on Stack Overflow, I cannot offer a suggestion for a workaround because I'm not sure what you're trying to do. At least you now know why it isn't working.
Good luck.

Email Line Height Html

I am tearing my hair out on how to get things to display properly in email with signatures in Mobile devices.
I tried in HTML and Word.
I have tried making it in Word which had the best result, only that when reading it in Mobile version of Gmail and Outlook, for Android, that the line heights are way too big and tables are not displaying properly as seems theyre also getting this massive line heights in them even though they are blank.
I done some research and it says that Gmail seem to change your line heights? I havent been able to work out in how to fix it.
I have just ripped back the other parts and have the basic code here:
JS Fiddle
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<style>
p {
font-size: 8pt;
line-height: 12pt!important;
margin: 0;
}
</style>
</head>
<body>
<table width="320px" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="padding:10.0pt 5.4pt 0pt 5.4pt; border-top: 5px solid #2E38A5; border-bottom: 5px solid #2E38A5; "><table width="320px" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td height="10pt" colspan="4" align="right" style="" >Logo</td>
</tr>
<tr>
<td colspan="4"></td>
</tr>
<tr>
<td colspan="3"><p style="line-height: 12pt; margin: 0">First Last</p>
<p style="line-height: 12pt; margin: 0">Sales Director</p></td>
<td width="30"> </td>
</tr>
<tr>
<td height="10pt" colspan="3"></td>
<td height="10pt"></td>
</tr>
<tr>
<td width="22" height="10pt"></td>
<td width="18"></td>
<td width="250" align="right"><p style="line-height: 8pt">+61 (0) 400 000 000 / +000 9000 0000</p>
<p style="line-height: 8pt">boris#email.com / www.website.com</p>
</td>
<td height="10pt"></td>
</tr>
<tr>
<td height="10pt" colspan="4"></td>
</tr>
<tr>
<td height="10pt" colspan="4"></td>
</tr>
<tr>
<td height="10pt" colspan="4"></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
<p> </p>
</body>
</html>
Also tried some methods other people had suggested to remove the links from phone numbers and email and have had no success with tags etc. Is there a more recent trick?
Thanks. Hopefully I am specific enough.

How to create listview in android with mixed of checkbox and edittext along with textview?

<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 15px;
}
</style>
</head>
<body>
<table style="width:100%">
<tr>
<th>S.NO</th>
<th>Description</th>
<th>Observation</th>
</tr>
<tr>
<td>1</td>
<td>Check the U/S Wheel assembly and the accompanying documents are available.</td>
<td>-</td>
</tr>
<tr>
<td>2</td>
<td>Check the tyre pressure as received condition _________________ Psi.</td>
<td>-</td>
</tr>
<tr>
<td>3</td>
<td>Carryout leak test on Over inflation Valve <input type="checkbox"> & Thermal fuse<input type="checkbox"></td>
<td>-</td>
</tr>
</table>
</body>
</html>
How to create this kind of table in android with run-time value?
I want to create listview with mix of checkbox and edittext to fill the survey form.
example shown in snippet, kindly look over it. Kindly help me get out from this.
Thanks in advance.

HTML on Outlook for Android not showing buttons as expected

I am creating an HTML Email template following the next one: transactional html email templates and in particular: this one.
I have inlined my css using zurb foundation inliner, and hosted the template on SendGrid.
Inline HTML/CSS:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">
<meta name="viewport" content="width=device-width" style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">
<title style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">Alerts e.g. approaching your limit</title>
</head>
<body style="-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:none;background-color:#f6f6f6;box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;height:100%;line-height:1.6;margin:0;padding:0;width:100%!important">
<style type="text/css">
#media only screen and (max-width:640px) {
h1,
h2,
h3,
h4 {
font-weight: 600!important;
margin: 20px 0 5px!important
}
h1 {
font-size: 22px!important
}
h2 {
font-size: 18px!important
}
h3 {
font-size: 16px!important
}
.container {
width: 100%!important
}
.content,
.content-wrapper {
padding: 10px!important
}
.invoice {
width: 100%!important
}
}
</style>
<table class="body-wrap" style="background-color:#f6f6f6;box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0;width:100%">
<tbody>
<tr style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">
<td style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0;vertical-align:top"> </td>
<td class="container" style="box-sizing:border-box;clear:both!important;display:block!important;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0 auto!important;max-width:600px!important;padding:0;vertical-align:top"
width="600">
<div class="content" style="box-sizing:border-box;display:block;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0 auto;max-width:600px;padding:20px">
<table cellpadding="0" cellspacing="0" class="main" style="background:#fff;border:1px solid #e9e9e9;border-radius:3px;box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0" width="100%">
<tbody>
<tr style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">
<td class="alert alert-warning" style="background:#ff9f00;border-radius:3px 3px 0 0;box-sizing:border-box;color:#fff;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:16px;font-weight:500;margin:0;padding:20px;text-align:center;vertical-align:top">Warning: You're approaching your limit. Please upgrade.</td>
</tr>
<tr style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">
<td class="content-wrap" style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:20px;vertical-align:top">
<table cellpadding="0" cellspacing="0" style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0" width="100%">
<tbody>
<tr style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">
<td class="content-block" style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0 0 20px;vertical-align:top">You have <strong style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">1 free report</strong> remaining.</td>
</tr>
<tr style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">
<td class="content-block" style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0 0 20px;vertical-align:top">Add your credit card now to upgrade your account to a premium plan to ensure you don't miss out on any reports.</td>
</tr>
<tr style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">
<td class="content-block" style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0 0 20px;vertical-align:top"><a class="btn-primary" href="http://www.mailgun.com" style="background-color:#348eda;border:solid #348eda;border-radius:5px;border-width:10px 20px;box-sizing:border-box;color:#FFF;cursor:pointer;display:inline-block;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;font-weight:700;line-height:2;margin:0;padding:0;text-align:center;text-decoration:none;text-transform:capitalize">Upgrade my account</a></td>
</tr>
<tr style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">
<td class="content-block" style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0 0 20px;vertical-align:top">Thanks for choosing Acme Inc.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<div class="footer" style="box-sizing:border-box;clear:both;color:#999;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:20px;width:100%">
<table style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0" width="100%">
<tbody>
<tr style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">
<td class="aligncenter content-block" style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:12px;margin:0;padding:0 0 20px;text-align:center;vertical-align:top">Unsubscribe from these alerts.</td>
</tr>
</tbody>
</table>
</div>
</div>
</td>
<td style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0;vertical-align:top"> </td>
</tr>
</tbody>
</table>
</body>
</html>
When I send it to Gmail:
When I send it to outlook (problem):
Question: How could I fix the button to look on Outlook for Android like intended?
Note that this doesn't happen on Desktop Outlook application, nor the outlook application for iOS.
There are a few different ways to add buttons to email using html, you can read more about the best ways here
I used a nested table padding approach which will work for outlook mobile, code below. Please bare in mind that this will only make the actual link clickable and not the whole button.
If you absolutely need the whole button to be clickable, use one of the other methods in the linked page.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">
<meta name="viewport" content="width=device-width" style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">
<title style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">Alerts e.g. approaching your limit</title>
</head>
<body style="-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:none;background-color:#f6f6f6;box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;height:100%;line-height:1.6;margin:0;padding:0;width:100%!important">
<style type="text/css">
#media only screen and (max-width:640px) {
h1,
h2,
h3,
h4 {
font-weight: 600 !important;
margin: 20px 0 5px !important;
}
h1 {
font-size: 22px !important;
}
h2 {
font-size: 18px !important;
}
h3 {
font-size: 16px !important;
}
.container {
width: 100% !important;
}
.content,
.content-wrapper {
padding: 10px !important;
}
.invoice {
width: 100% !important;
}
}
</style>
<table class="body-wrap" style="background-color:#f6f6f6;box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0;width:100%">
<tbody>
<tr style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">
<td style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0;vertical-align:top"> </td>
<td class="container" style="box-sizing:border-box;clear:both!important;display:block!important;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0 auto!important;max-width:600px!important;padding:0;vertical-align:top"
width="600">
<div class="content" style="box-sizing:border-box;display:block;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0 auto;max-width:600px;padding:20px">
<table cellpadding="0" cellspacing="0" class="main" style="background:#fff;border:1px solid #e9e9e9;border-radius:3px;box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0" width="100%">
<tbody>
<tr style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">
<td class="alert alert-warning" style="background:#ff9f00;border-radius:3px 3px 0 0;box-sizing:border-box;color:#fff;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:16px;font-weight:500;margin:0;padding:20px;text-align:center;vertical-align:top">Warning: You're approaching your limit. Please upgrade.</td>
</tr>
<tr style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">
<td class="content-wrap" style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:20px;vertical-align:top">
<table cellpadding="0" cellspacing="0" style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0" width="100%">
<tbody>
<tr style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">
<td class="content-block" style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0 0 20px;vertical-align:top">You have <strong style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">1 free report</strong> remaining.</td>
</tr>
<tr style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">
<td class="content-block" style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0 0 20px;vertical-align:top">Add your credit card now to upgrade your account to a premium plan to ensure you don't miss out on any reports.</td>
</tr>
<tr>
<td>
<table width="185" style="Margin:0;border-spacing:0;max-width:185px;">
<tr>
<td width="100%" style="padding:15px 5px 17px 5px;border-radius:4px;background-color:#348eda;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;line-height:22px;font-weight:bold;color:#ffffff;text-align:center;vertical-align:top;">
<a href="http://www.mailgun.com" style="text-decoration:none;color:#ffffff;display:block;">
Upgrade My Account
</a>
</td>
</tr>
</table>
</td>
</tr>
<tr style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">
<td class="content-block" style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0 0 20px;vertical-align:top">Thanks for choosing Acme Inc.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<div class="footer" style="box-sizing:border-box;clear:both;color:#999;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:20px;width:100%">
<table style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0" width="100%">
<tbody>
<tr style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0">
<td class="aligncenter content-block" style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:12px;margin:0;padding:0 0 20px;text-align:center;vertical-align:top">Unsubscribe from these alerts.</td>
</tr>
</tbody>
</table>
</div>
</div>
</td>
<td style="box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:14px;margin:0;padding:0;vertical-align:top"> </td>
</tr>
</tbody>
</table>
</body>
</html>
This is how I fixed the problem.
Outlook for Android was not centering my button. This code was centered in every other email client. My email width is 580px. I added margin: 0; Margin-right: 190px; Margin-left: 190px; to the table in-line style.
<table cellpadding="0" cellspacing="0" border="0" align="center" style="width: 200px; padding: 0px; margin: 0; Margin-right: 190px; Margin-left: 190px;">
<tr align="center">
<td bgcolor="#ffffff" align="center" width="200" class="center button large-button" style="padding: 8px; margin: 0;">
<p style="text-align: center; color: #6f5a95 !important; padding: 0px; margin: 0;">
View new plans </p>
</td>
</tr>
iPhone 5 and 6 shifted to the left, so I added margin: 0px which caused them to ignore the Margin with a capital M. Margin with a capital M gets picked up by Outlook, but ignored by most major email clients.

Horizontal scroll view in phonegap

In my phonegap app i want to implement horizontal scroll view. My html code
<div id="songsListPage" data-role="page">
<div id="alphabets" >
<a href="#" >#</a>
<a href="#" >A</a>
<a href="#" >B</a>
<a href="#" >C</a>
<a href="#" >D</a>
<a href="#" >E</a>
<a href="#" >F</a>
<a href="#" >G</a>
<a href="#" >H</a>
<a href="#" >I</a>
<a href="#" >J</a>
<a href="#" >K</a>
<a href="#" >L</a>
<a href="#" >M</a>
</div>
<div id="songs_list" data-role="content"> <!-- this should not scroll, but it is and showing white background on right side -->
<ul id="songsList" data-role="listview" data-theme="a"></ul> <!-- list is populated dynamically -->
<p>This is songs page</p>
<a href="player.html" id="playerBtn" data-role="button" class="ui-btn-active" ></a>
</div>
</div>
my css
#alphabets {
background:#000000;
display: block;
padding: 5px;
clear: both;
height: 30px;
margin-bottom: 22px;
padding-left: 5px;
padding-right: 5px;
padding-top: 5px;
width: 200%;
overflow-x: auto;
}
#alphabets a{ color: #ffffff; margin-left: 5px}
by giving "width: 200%" and "overflow-x: auto" i'm getting horizontal scroll but the problem is my rest of the screen is also scrolling horizontally so is there is any way to achieve this ?
Old Answer
The New HTML
<div id="songsListPage" data-role="page">
<table id="alphabets"> <!-- change "div" tag to "table" tag -->
<tr>
<td href="#">#</td> <!-- and "a" to "td" tag -->
<td href="#">A</td>
<td href="#">B</td>
<td href="#">C</td>
<td href="#">D</td>
<td href="#">E</td>
<td href="#">F</td>
<td href="#">G</td>
<td href="#">H</td>
<td href="#">I</td>
<td href="#">J</td>
<td href="#">K</td>
<td href="#">L</td>
<td href="#">M</td>
<td href="#">N</td>
<td href="#">O</td>
<td href="#">P</td>
<td href="#">Q</td>
<td href="#">R</td>
<td href="#">S</td>
<td href="#">T</td>
<td href="#">U</td>
<td href="#">V</td>
<td href="#">W</td>
<td href="#">X</td>
<td href="#">Y</td>
<td href="#">Z</td>
</tr>
</table>
<div id="songs_list" data-role="content">
<ul id="songsList" data-role="listview" data-theme="a"></ul>
<!-- list is populated dynamically -->
<p>This is songs page</p>
<a href="player.html" id="playerBtn" data-role="button" class="ui-btn-active" ></a>
</div>
</div>
Updated CSS
#alphabets {
background:#000000;
display: block;
padding: 5px;
clear: both;
height: auto;
padding-left: 5px;
padding-right: 5px;
padding-top: 5px;
width: auto; <!-- changed width from 200% to auto -->
overflow-x: auto;
}
#alphabets td{ color: #ffffff; font-size: large;
margin-left: 5px; padding-left: 5px; padding-right: 5px;}
<!-- rest of the changes in css are for proper view (UI) like height: auto; padding-left: 5px; (in td) etc -->
http://jsfiddle.net/CXAWE/ (for those who do not want a TABLE TR TD solution)
This will work perfectly in phone (android) browser. The Table TR works better for mobiles - it will and always has and continue to do so. I always use a TABLE for guaranteed results especially in this case.
Updated New Answer
HTML for any mobile solution.
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HTML5 Alternative to Mobile WAP and iPad/iPhone etc</title>
<!-- Mobile Web App Acceleration - Powered by WordCompress.net //-->
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"/>
<link rel="stylesheet" href="css/style.css" type="text/css" media="all, handheld" />
</head>
<body>
<div id="b">
<div id="content">
</div>
</div>
</body>
</html>
CSS
body { overflow-x: hidden; }
#b {
margin: 1px;
}
#content {
background: none repeat scroll 0 0 #FFFFFF;
}
Notice viewport width is device-width and also notice that the body, has no width, and neither does the content. You can now guarantee that all phones will display 100%. You can change the overflow to y or x too.

Categories

Resources