Outlook collapse of table cells in HTML emails - outlook

I have come across this issue and have yet to be able to find a solution to it. With an html e-mail I have found that in some Outlook programs it will collapse the cell. Both 2007/2010 For instance:
<tr>
<td width="10"><img></td>
<td width="80">Copy</td>
<td width="10"><img></td>
</tr>
What happens is that Outlook ignores the width of the middle column's cell. It also doesn't matter if I use CSS for the widths.
<tr>
<td style="width:10px;"><img></td>
<td style="width:80px;">Copy</td>
<td style="width:10px;"><img></td>
</tr>
This has the same results.
The thing I haven't been able to figure out, is the setting in Outlook that causes this collapsing of the cell's width. And typically, it only happens in Outlook for the CEO of our company. I no longer code a cell with copy in it this way anymore as I have a more rock solid way that works, but sometimes marketing thinks they know what they are doing and changes the code on me thinking it will work, when I know it will not on the CEO's computer in Outlook.
Does anybody know what setting in Outlook causes this? I'd love to have this setting on my computer so I don't need to but the CEO to test it.

Can you provide a more extensive code example w/ a whole table and not just one row? Would help give a clue why this is happening.
Anyway, something that works for me in Outlook is to add a top row in the table that forces the column widths to exact heights. A 1x1 transparent GIF, with widths set in addition to table cell widths, seems to work as a 'brute force' method that even Outlook listens to:
<table>
<tr>
<td width="10" height="1"><img width="10" height="1" /></td>
<td width="80" height="1"><img width="80" height="1" /></td>
<td width="10" height="1"><img width="10" height="1" /></td>
</tr>
and then rows beneath that conform to the column widths of that top row.

I was running into this issue in Outlook 2013 for Windows. It worked fine in Outlook for Mac (and Gmail, and pretty much every other modern email client) but in Outlook 2013 for Windows, it would completely collapse everything.
The solution was simple: do NOT put in px if you are declaring a pixel width (with the exception of inline styles). You have to be really old school. Here was my final (working) code:
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="1" align="left" valign="top" bgcolor="#ffffff"><img src="#"></td>
<td width="150" align="center" bgcolor="#ffffff"><span style="font-size: 11px; font-family: Arial, Helvetica, sans-serif; font-weight: lighter;"><a style="color: #5f6062; text-decoration: none;" href="#">SECTION 1</a></span></td>
<td width="150" align="center" bgcolor="#ffffff"><span style="font-size: 11px; font-family: Arial, Helvetica, sans-serif; font-weight: lighter;"><a style="color: #5f6062; text-decoration: none; text-decoration: none;" href="#">SECTION 2</a></span></td>
<td width="150" align="center" bgcolor="#ffffff"><span style="font-size: 11px; font-family: Arial, Helvetica, sans-serif; font-weight: lighter;"><a style="color: #5f6062; text-decoration: none;" href="#">SECTION 3</a></span></td>
<td width="149" align="center" bgcolor="#ffffff"><span style="font-size: 11px; font-family: Arial, Helvetica, sans-serif; font-weight: lighter;"><a style="color: #5f6062; text-decoration: none;" href="#">SECTION 4</a></span></td>
</tr>
</table>

Related

Unable to click on "New Application or Top Up" Text present inside <td> tag in watir/ruby

I'm trying to click on the "New Application or Top Up" text that's present inside the <td> tag:
<button class="BIMG" tabindex="-1" id="T979" name="T979"style="border:0;background-color:transparent;left:14px;top:114px;width:193px;height`enter code here`:23px;z-index:2020; clip:rect(0px 193px 23px 0px);color:#28497b;">
<table class="T" style="top: 4px; left: 10px; width: 183px; height: 19px; font-weight: bold; font-size: 12px; font-family: Arial; color: rgb(40, 73, 123); text-decoration: underline;" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="vertical-align:top;text-align:left;">New Application or Top Up</td>
</tr>
</tbody>
</table>
</button>
Watir allows String & RegExp matching using the :text parameter:
browser.td(text: "New Application or Top Up")
browser.td(text: /New Application/)

Outlook 2013 on laptop and PC display image signature in different sizes. Why?

I did it on Thunderbird then send it to my laptop. It looks fine on laptop. I save it as signature on laptop, then I send it to my PC. I save the signature to my PC. Then I send it back to laptop. The image size will resize to smaller one like on the left picture.
<table border="0" cellpadding="0" cellspacing="0" width="600">
<tbody>
<tr width="600" height="96">
<td width="600" height="96" style="text-align:right">
<img src="a"
alt="">
</td>
</tr>
<tr>
<td width="600" height="20" style="text-align:right">
<a style="font-family:Arial, Helvetica Neue, Helvetica, sans-serif; text-decoration: none!important; font-size:11px; color:#006c86!important;" href="#"><span style="color: #006c86; text-decoration: none"><font color="#006c86">this.com</font></span></a> <font color="#006c86">|</font>
<a style="font-family:Arial, Helvetica Neue, Helvetica, sans-serif; text-decoration: none!important; font-size:11px; color:#006c86!important;" href="#"><span style="color: #006c86; text-decoration: none"><font color="#006c86">that.com</font></span></a> <font color="#006c86">|</font>
<a style="font-family:Arial, Helvetica Neue, Helvetica, sans-serif; text-decoration: none!important; font-size:11px; color:#006c86!important;" href="#"><span style="color: #006c86; text-decoration: none"><font color="#006c86">all.com</font></span></a>
</td>
</tr>
</tbody>
</table>
This is how the code looks like when I first put it in thunderbird. The image src i used data:image/jpeg;base64
Why does this happen? How to fix it?
Thank you
Outlook uses Word for rendering HTML markup of emails. All supported and unsupported HTML elements, attributes, and cascading style sheets properties are described in the following articles in MSDN:
Word 2007 HTML and CSS Rendering Capabilities in Outlook 2007 (Part 1 of 2)
Word 2007 HTML and CSS Rendering Capabilities in Outlook 2007 (Part 2 of 2)
Did you have a chance to check out the zoom level? When you hold the Ctrl button pressed try to scroll... Is the zoom level set to 100% all the time?
Did you have a chance to check out the HTML markup before and after? Is there any changes?

Outlook 2013 Images Enlarging

I have designed a html signature for outlook, it looks perfect in outlook when I send the e-mail and when I receive the e-mail in outlook - however in other e-mail client the images used within the signature are enlarged. The other e-mail clients I used were Mozilla Thunderbird and A webmail I use (mail.com). I have done much research, and found an article suggesting to change the res to 96dpi on my images which I did.
I can't post an image as a new user however you can see them at these links:
E-mail sent and received in outlook 2013: http://champ.website-admin.net/files/2015/01/e-mailexample.jpg
Received e-mail in thunderbird: http://champ.website-admin.net/files/2015/01/e-mailexample2.jpg
Here's my code:
<table width="600" height="140" border="0" cellspacing="0" cellpadding="0" style="font-family:'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', 'DejaVu Sans', Verdana, sans-serif; color:#d3a25b;">
<tbody>
<tr>
<td style="background-color:#2f2f2f; padding-left:10px; width:400px; height: 140px; line-height:1.2em;">
<font style="font-size:16px;"><b>Emma Woolward</b></font><br>
<font style="font-size:11px;"><b>operations#champresources.com.au</b><br>
<b><strong>1300 GO CHAMP</strong></b><br>
<b>P: 1300 462 426</b><br>
<b>www.champresources.com.au</b><br></font>
<font style="color:#2f2f2f; font-size:1px;"><b>.</b><br></font>
<b><img src="http://champ.website-admin.net/files/2015/01/facebook.jpg" style="float:left;"><font style="color:#282828">...<img src="http://champ.website-admin.net/files/2015/01/zeroharm.jpg" style="float:left; margin-left:5px;"></b><br></font></td>
<td style="width:300px; height: 140px; padding-left:0px;"><img src="http://champ.website-admin.net/files/2015/01/champemailsig.jpg" /></td>
</tr>
</tbody>
</table>
I think it's as simple as adding the width and height to the tag instead of the td.
EG:
<img width="300" src="http://champ.website-admin.net/files/2015/01/champemailsig.jpg" />

How to emulate min-width in IE8

The IE8 documentation says it supports min-width, but it doesn't seem to work for me.
The html I want to be a minimum width is in table cells.
I saw another question here which suggested adding a 1-pixel height div to each cell, with a width setting, but that doesn't work - IE renders it as 18 pixels high, for some reason.
Here is the html code:
<html>
<head>
<script src="jquery.js" type="text/javascript"></script>
<style type="text/css">
table.keyboard div.key {
height: 50px;
font-size:50px;
border: 5px outset gray;
min-width: 60px;
text-align: center;
}
table.keyboard div.spc {
height: 1px;
width: 60px;
background-color: green;
}
table.keyboard td:hover {
background-color: lightblue;
}
table.keyboard {
border: 3px inset blue;
}
</style>
</head>
<body>
<div id="body">
<div>Here is some stuff</div>
<table class='keyboard'>
<tbody>
<tr>
<td><div class='key'>1</div><div class='spc'></div></td>
<td><div class='key'>2</div><div class='spc'></div></td>
<td><div class='key'>3</div><div class='spc'></div></td>
<td><div class='key'>4</div><div class='spc'></div></td>
<td><div class='key'>5</div><div class='spc'></div></td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
The "spc" div appears 18 px high!
Of course, if min-width worked, I wouldn't need the div...
<table class='keyboard'>
<tbody>
<tr>
<td><div class='key'>1</div></td>
<td><div class='key'>2</div></td>
<td><div class='key'>3</div></td>
<td><div class='key'>4</div></td>
<td><div class='key'>5</div></td>
</tr>
</tbody>
</table>
Any clues?
Just to make this easier, I have put 3 different versions of this code on my website.
http://jsfiddle.net/3htmA/
IE8. your code works perfect.
The HTML TABLE spec uses COL to define column widths. See the following spec: http://www.w3.org/TR/html4/struct/tables.html#h-11.2.4
Here's an example of how it's used:
http://www.htmldog.com/guides/htmladvanced/tables/
Min-width on table cells works differently than block-level elements. Table cells are controlled on the column level, not on the individual cell level. If a given cell size increases or decreases, the entire column will be affected, unless explicitly controlled by the tag.
Try this:
table.keyboard .key
{
min-width:60px;
width: expression(this.width < 60 ? 60: true);
}
This width expressions is an alternative for min-width, it supposed to be a workaround for older versions of IE.
I think your problem is that your column is determining the width of the element, not the div.
EDIT:
Also check if your browser is not in Compatibility mode.

Table row height in Firefox

Due to current limitations on getting DIV tags to work well across browser platforms for the particular liquid layout I desire, I have opted to use a combination of Tables and DIVs for layout. That being said, a couple of issues remain.
The FIRST issue is that in Firefox, my table row height for my footer is being rendered differently than it is being rendered in IE when using a table with a height of 100%. What happens is that in Firefox the footer row for the table has a height that is greater than the height specified for the table row. This, in turn, throws off my footer layout.
Here is the code for the page:
<html>
<head>
<meta NAME="DESCRIPTION" CONTENT="Cold Fusion Applications and Development">
<meta NAME="keywords" CONTENT="cold fusion, coldfusion, sql server, graphic design, houston, texas, tx, web developer, web development, e-commerce, survey, surveys, web applications, php, mysql, access, foxpro, sql, perl, shopping cart, web programming, macromedia, webmaster, html, cfml, xml, 77057, cfware, cfware.com, www.cfware.com, hosting, dhtml, dynamic html, web programmer, graphic designer, website, resume">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<!-- BODY -->
<body topmargin="0" bottommargin="0" rightmargin="0" leftmargin="0">
<!--TABLE I -->
<table class="fullheight" width="100%" height="100%" min-height="100%" border="1" align="center" cellpadding="0" cellspacing="0">
<tr><td height="116" align="center" valign="top">
<!-- HEADER -->
<div class="header">
<div class="lfc">Cornerstone</div>
<div class="rfl"><img src="c4sqlogo.gif" width="295" height="68"></div>
<div class="lf4">Foursquare</div>
</div>
<div class="spacer"></div>
<!-- HEADER END -->
</td>
</tr>
<tr><td align="center" valign="center" bgcolor="#FFFFFF">
<!-- CONTENT -->
<div class="content">
<table class="fullheight" width="100%" height="100%">
<tr>
<td></td>
<td></td>
<td></td>
</tr><tr>
<td></td>
<td align="center" valign="middle">
<h1 class="font-black">Cornerstone Foursquare Church</h1>
<br>
<h2>7791 Hillbarn Dr. Houston, TX 77040</h2>
<br>
<h2>(713) 856 - 7773</h2>
<br>
<br>
<h3>Service Times:<br>Sunday Morning Worship 10:30AM<br>Sunday Evening Bible Study 6:00PM
<br>Wednesday Evening Bible Study and Prayer 7:00PM</h3>
</td>
<td></td>
<tr>
<td></td>
<td></td>
<td></td>
</tr><tr>
</table>
</div>
<!-- CONTENT END -->
</td>
</tr>
<tfoot height="28"><td height="28" align="center" valign="middle" bgcolor="#FFFFFF">
<!-- FOOTER -->
<div class="clearspacer"><img src="1.gif" height="10" width="1"></div>
<div class="footer"><div class="footertext"> w w w . c 4 s q . o r g </div></div>
<!-- FOOTER END -->
</td>
</tr>
</table>
<!-- TABLE I END -->
</body>
</html>
And here is the code for the sytle sheet:
html, body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: :#a02f1d;
height: 100%;
width: 100%;
}
a {
color: #ffffff;
text-decoration: none;
font-size: 12;
font-weight: 500;
}
.header {
color: #ff0000;
margin: 0 auto;
width: 760px;
height: 116px;
background-image: url(stripe.gif);
background-repeat: repeat-x;
}
.fullheight {
height:100%;}
.lf4 {
float: left;
margin-top: 0px;
clear: left;
width: 240px;
margin-left: 190px;
color: #a02f1d;
font-size: 26px;
font-weight: semi-bold;
font-style: italic;
}
.lfc {
float: left;
margin-top: 8px;
margin-left: 20px;
color: #a02f1d;
font-size: 48px;
font-weight: semi-bold;
font-style: italic;
}
.rfl {
float: right;
margin-top: 24px;
margin-right: 20px;
clear: right;
}
.content {
margin: 0 auto;
width: 760px;
overflow: hidden;
color: :#a02f1d;
}
.spacer {
background-color:#a02f1d;
margin: 0 auto;
width: 760px;
height: 4px;
overflow: hidden;
}
.clearspacer {
background-color:#000000;
}
.footer {
color: #ffffff;
background-color:#a02f1d;
margin: 0 auto;
width: 760px;
height: 30px;
clear: both;
}
.footertext {
color:#ffffff;
margin-top: 6px;
font-size: 12px;
}
The SECOND issue has to do with modifying the existing layout so that there is a centered vertical area of 760px in width that displays in a shade of color different from the surrounding viewport. The primary difficulty is that in order to get my footer to stick to the bottom in both browsers and resize with the viewport, I had to re-adopt a table layout. The current strategy, however, is to use as few nests as possible in order to benefit from the speed and clarity from using DIVs. I would opt to use a DIV layout to the exclusion of a TABLE layout if it were not for the apparently, currently insoluble problem of getting a working sticky-footer to work with a DIV liquid layout.
I know this is quite unrelated, but I recommend that you use the w3c validator to validate your HTML once in a while.
A couple suggestions:
Add a doctype - if use use the right one you can get IE to standards mode rather than quirks mode http://www.quirksmode.org/css/quirksmode.html, so behaviour will be more consistent between IE and other browsers.
As suggested by K4emic - validate your markup.
Add a css reset to zero default margins and paddings, a good starting point here http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/.
You will find that these things will make chasing down layout bugs a lot easier. Otherwise, you just won't know where to start, is it your css, your html, the default browser stylings, the rendering mode of IE......?
As the other responders pointed out you first have to make sure that your document is well formed. That is, it must conform to a DTD. I will point out one issue that is easy to spot:
<tfoot height="28"><td height="28" align="center" valign="middle" bgcolor="#FFFFFF">
<!-- FOOTER -->
<div class="clearspacer"><img src="1.gif" height="10" width="1"></div>
<div class="footer"><div class="footertext"> w w w . c 4 s q . o r g </div></div>
<!-- FOOTER END -->
</td>
</tr>
</table>
In this snippet you can see that your
<tfoot>
element is unclosed. It should contain
<tr>
but that is missing.
These small errors are probably causing the inconsistent behavior that you are witnessing. After they have been corrected if you are still getting the behavior then you can look at the browser differences. Some HTML editor like Frontpage and Dreamweaver can be set to out put code that conforms to a DTD and highlight areas that do not conform. I would recommend using one.

Resources