Adjust HTML E-mail To Render The Same in Different Clients - css

I am putting together a html based e-mail for distribution to our subscribers. However, when I render it in various clients, it is coming out slightly differently. The major difference that I see is that in some clients the main picture is offset to the left, and the grid boxes may have a different height depending on the number of lines contained. My aim was to reserve enough space for multiple lines so that all boxes would be the same height. Can anyone help me to locate the problem areas? The client in the picture with the problems is Outlook 2003, and the correct one is gmail in Chrome.
Because the html is too long to fit in stackoverflow, I'm including extracts that produce the main item with the offset picture, and the various sized grid box.
Strange offset:
<tr>
<td height="15" style="text-align:center" width="100%"></td></tr><tr>
<td border="0" width="600" style="text-align:center" align="center">
<img alt="" border="0" width="600" height="400" align="top" src="https://ci5.googleusercontent.com/proxy/vTfZfEiq_KN8RAd8D80hICfjyqCddT8oyJJNwnuvZ8D7jg4mbFEbJab51vi_ZiMrHNRitMhAtMu_hSU9Eiy1iNjIEz8YmmlkCx6M6C1lQmBkC6jm7ye1uSoKDMmq8XVo-qD0ZXA=s0-d-e1-ft#https://img.grouponcdn.com/deal/3YewhZBYt2iywAzJsuHy/ZP-960x582/v1/t440x300.jpg" style="width:600px;min-height:400px">
</td>
</tr>
<tr>
<td>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="600">
<tbody>
<tr><td>
<table width="100%" border="0" cellpadding="10" cellspacing="0">
<tbody>
<tr>
<td border="0" bgcolor="#403e3e" style="background-color:#403e3e;font-family:Myriad Pro,Helvetica,Arial,sans-serif;font-size:16px;font-weight:normal;color:#ffffff;line-height:18px;text-align:left">
<img height="23" style="min-height:23px" src="https://ci3.googleusercontent.com/proxy/FYU-iKV58t7t1Y09W8HkB8ZvJUWC53Zs279rZhUHmFlI6GwdK9THzm1007Ty7LgiJAlwsOhpGzsZL7-IU-1WHk5fdBo80RCk0b8_Xc_LfDNnqw=s0-d-e1-ft#http://www.example.com/images/logos/partners/small/groupon.png" alt="Gourmet All-Inclusive 4.5-Star Playa del Carmen Resort">
</td>
<td border="0" bgcolor="#403e3e" style="background-color:#403e3e;font-family:Myriad Pro,Helvetica,Arial,sans-serif;font-size:16px;font-weight:normal;color:#ffffff;line-height:18px;text-align:right">
<span>$1179</span>
</td>
</tr>
<tr>
<td border="0" height="30" colspan="2" valign="top" bgcolor="#403e3e" style="vertical-align:top;height:30px;background-color:#403e3e;font-family:Myriad Pro,Helvetica,Arial,sans-serif;font-size:16px;font-weight:normal;color:#ffffff;line-height:18px;text-align:left">
Gourmet All-Inclusive 4.5-Star Playa del Carmen Resort
</td>
</tr>
<tr>
<td border="0" height="30" colspan="2" valign="top" bgcolor="#403e3e" style="vertical-align:top;height:30px;background-color:#403e3e;font-family:Myriad Pro,Helvetica,Arial,sans-serif;font-size:16px;font-weight:normal;color:#ffffff;line-height:18px;text-align:left">
Branchville, NJ, USA
</td>
</tr>
</tbody>
</table>
</td>
</tr></tbody>
</table>
</td>
</tr>
Various sized boxes:
<tr>
<td align="center" valign="top">
<table align="center" cellpadding="0" cellspacing="0" width="600">
<tbody>
<tr>
<td>
<table align="left" border="0" cellpadding="0" cellspacing="0" style=
"background-color:#403e3e" width="290">
<tbody>
<tr>
<td border="0" width="290"><a href=
"#147d3134c7aae5a7_147d3131083faac4_" style="border:none"><img alt=
"" border="0" height="180" src=
"https://ci4.googleusercontent.com/proxy/2iCMcbaq9UymG0sHx0JXF9wuBHu-8ibBC66U7s1q7i7Lo5zNS83olrIm7NNBuhybni869s64dxK1_5u13bYUudnGh3fh680G2yLGIc9rQ_YFWe2YLdExA4UUO5A2j_7rJlhLmXQ=s0-d-e1-ft#https://img.grouponcdn.com/deal/rHsqnohK7vGd79o7hGUq/VQ-960x582/v1/t440x300.jpg"
style="width:290px;min-height:180px;display:block" width=
"290" /></a></td>
</tr>
<tr>
<td>
<table border="0" cellpadding="7" cellspacing="0" width="100%">
<tbody>
<tr>
<td border="0" bgcolor="#403E3E" style=
"background-color:#403e3e;font-family:Myriad Pro,Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;color:#ffffff;line-height:18px;text-align:left">
<img height="15" src=
"https://ci3.googleusercontent.com/proxy/FYU-iKV58t7t1Y09W8HkB8ZvJUWC53Zs279rZhUHmFlI6GwdK9THzm1007Ty7LgiJAlwsOhpGzsZL7-IU-1WHk5fdBo80RCk0b8_Xc_LfDNnqw=s0-d-e1-ft#http://www.example.com/images/logos/partners/small/groupon.png"
style="min-height:15px" alt="Groupon" /></td>
<td border="0" bgcolor="#403E3E" style=
"background-color:#403e3e;font-family:Myriad Pro,Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;color:#ffffff;line-height:15px;text-align:right">
<span>$285</span></td>
</tr>
<tr>
<td border="0" height="30" valign="top" bgcolor="#403E3E"
colspan="2" style=
"overflow:hidden;vertical-align:top;height:30px;background-color:#403e3e;font-family:Myriad Pro,Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;color:#ffffff;line-height:15px;text-align:left">
<a href="http://-featured_url-" style=
"text-decoration:none;color:#ffffff;font-size:13px" target=
"_blank">Luxury Villas & Gourmet Meals in Puerto
Vallarta</a></td>
</tr>
<tr>
<td border="0" height="30" valign="top" bgcolor="#403E3E"
colspan="2" style=
"vertical-align:top;height:30px;background-color:#403e3e;font-family:Myriad Pro,Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;color:#ffffff;line-height:15px;text-align:left">
Puerto Vallarta, Mexico</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td border="0" bgcolor="#FFFFFF" height="15" width="100%">
</td>
</tr>
</tbody>
</table>
<table align="right" border="0" cellpadding="0" cellspacing="0" style=
"background-color:#403e3e" width="290">
<tbody>
<tr>
<td border="0" width="290"><a href=
"#147d3134c7aae5a7_147d3131083faac4_" style="border:none"><img alt=
"" border="0" height="180" src=
"https://ci6.googleusercontent.com/proxy/rhQa6yfks-smgpfVft9mFyFjy-buDbxqyC7skH8tBNv-KfX5FspdLl6GpcdipcquRGoQreMi29C5cmhGaXFp8c6kF4P84Duam0ZfHGGqQZUudPbo5dXvcAOmj2qFfCfTB3KnZEg=s0-d-e1-ft#https://img.grouponcdn.com/deal/deYNpeAfGJxahmvmev46/SV-960x582/v1/t440x300.jpg"
style="width:290px;min-height:180px;display:block" width=
"290" /></a></td>
</tr>
<tr>
<td>
<table border="0" cellpadding="7" cellspacing="0" width="100%">
<tbody>
<tr>
<td border="0" bgcolor="#403E3E" style=
"background-color:#403e3e;font-family:Myriad Pro,Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;color:#ffffff;line-height:18px;text-align:left">
<img height="15" src=
"https://ci3.googleusercontent.com/proxy/FYU-iKV58t7t1Y09W8HkB8ZvJUWC53Zs279rZhUHmFlI6GwdK9THzm1007Ty7LgiJAlwsOhpGzsZL7-IU-1WHk5fdBo80RCk0b8_Xc_LfDNnqw=s0-d-e1-ft#http://www.example.com/images/logos/partners/small/groupon.png"
style="min-height:15px" alt="Groupon" /></td>
<td border="0" bgcolor="#403E3E" style=
"background-color:#403e3e;font-family:Myriad Pro,Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;color:#ffffff;line-height:15px;text-align:right">
<span>$99</span></td>
</tr>
<tr>
<td border="0" height="30" valign="top" bgcolor="#403E3E"
colspan="2" style=
"overflow:hidden;vertical-align:top;height:30px;background-color:#403e3e;font-family:Myriad Pro,Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;color:#ffffff;line-height:15px;text-align:left">
<a href="http://-featured_url-" style=
"text-decoration:none;color:#ffffff;font-size:13px" target=
"_blank">Charming Northern Michigan Inn near Lakes</a></td>
</tr>
<tr>
<td border="0" height="30" valign="top" bgcolor="#403E3E"
colspan="2" style=
"vertical-align:top;height:30px;background-color:#403e3e;font-family:Myriad Pro,Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;color:#ffffff;line-height:15px;text-align:left">
Denton Township, MI, USA</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td border="0" bgcolor="#FFFFFF" height="15" width="100%">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
This is a picture of how it should look (gmail):
This is a picture of how it looks in outlook 2003:

Your question is a neverending story.... few suggestions.
reset as much default value, as possible
use tables, but reset cellpadding cellspacing and border values to 0
do not use colspan, rowspan, because a few clients do not support it, and rest of the clients may handle it differently
you need to double/triple declare the css values (always write css inline, and in head style)
no margins, only padding values, and only on TD elements
always give exact width and height for images, (and apply display:block to remove unwanted spaces below)
set font-size 0 on body, and after set font-size on every element where you need, to avoid invisible characters on inline elements.
Height values on TD sometimes works, sometimes not, thats why a lot of ppl use spacer images. I recommend an empty TD with padding-top:30px is much stable....
I'm a frontend developer #EDMdesigner.com

Related

Background image does not stretch fully in Outlook and Windows Mail

I'm having this extremely odd problem with creating bulletproof background images, and this thing is driving me nuts.
Issue:
There are two variable content blocks and they include code that makes a background image appear on Outlook 2013 and Windows 10 Mail.
While the background images do show, the v:rect created seems to refuse to take up the 800 px width it's supposed to. See attached for a demonstration of how it looks in Microsoft Outlook 2013.
It shows fine in Outlook 2010.
Code for the first block (which is pretty much suffering the same issue as the 2nd) for brevity:
<!-- // Begin Module: Welcome Block \\ -->
<table align="center" border="0" cellpadding="0" cellspacing="0" class="wrapper_table" mc:repeatable="layout" mc:variant="Welcome Block" >
<tbody>
<tr>
<td bgcolor="#3b3f40" style="background:rgb(59,63,64) url('https://gallery.mailchimp.com/0728d953751ef38036e722a85/images/0ecfdaa9-07ef-4f83-8e45-ef4ed827bcb0.jpg'); background-repeat:no-repeat; background-position: center top 100% 100%; background-size: 100% 100%; width:800px; max-width:800px;">
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:800px; height:340px; mso-position-horizontal:center;">
<v:fill type="frame" src="https://gallery.mailchimp.com/0728d953751ef38036e722a85/images/0ecfdaa9-07ef-4f83-8e45-ef4ed827bcb0.jpg" color="#3b3f40" />
<v:textbox style="mso-fit-shape-to-text:true" inset="0,0,0,0">
<![endif]--><div>
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td class="content" style="width:800px;">
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tbody>
<tr>
<td class="padding" style="width:20px;">
</td>
<td class="content_row" align="center" style="width:760px;">
<table cellpadding="0" cellspacing="0" border="0" align="center" width="100%" class="mobile_centered_table">
<tbody>
<tr>
<td class="section_h" height="90">
</td>
</tr>
<tr>
<td class="content_row" valign="top" align="center" style="color:#ffffff;font-family:Montserrat, Arial, sans-serif;font-size:36px;font-weight:700;line-height:36px;text-transform:uppercase;width:760px;">
<span class="white_text" mc:edit="welcome_header"> WELCOME TO ULTIMAIL </span>
</td>
</tr>
<tr>
<td height="15" class="space_class" style="font-size:1px;line-height:1px;"> 
</td>
</tr>
<tr>
<td class="white_text" align="center" style="color:#ffffff;font-family:Montserrat, Arial, sans-serif;font-size:16px;font-weight:400;line-height:24px;width:760px;" mc:hideable mc:edit="welcome_subheader">
Curabitur et ligula. Ut molestie a, ultricies porta urn vestibulum commodo
</td>
</tr>
<tr>
<td height="30" colspan="3">
</td>
</tr>
<tr>
<td valign="middle" align="center">
<table cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td bgcolor="#0d793d" class="button blue_button" align="center" width="160" height="45" style="border-radius:100px;display:block;background-color:#0d793d;border-color:rgb(57,57,57);border-width:0px;" mc:hideable mc:edit="a9">
<table cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td style="color:#ffffff;font-family:Montserrat, Arial, sans-serif;font-size:14px;font-weight:400;text-align:center;text-transform:uppercase;" align="center">
<a class="white_text" href="#" target="_blank" style="color:#ffffff;display:block;line-height:45px;text-decoration:none;width:100%;">
read more
</a>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
<td class="padding" style="width:20px;">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td height="40">
</td>
</tr>
<tr>
<td height="45" class="nomobile">
</td>
</tr>
</tbody>
</table></div>
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]-->
</td>
</tr>
</tbody>
</table>
<!-- // End Module: Welcome Block \\ -->
See it malfunction in Outlook 2013: https://i.stack.imgur.com/mwTKx.png
See it malfunction in Windows Mail 10: https://i.stack.imgur.com/bXczG.png

Marquee is scrolling very fast or something is wrong

this is my website http://divyajyoti.net but marquee is not working properly i tried to change scrollamount to 0, 1,2,3,4 and it was still not working properly please see the code and help me what to do thanks
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>:: Welcome to Divya Jyoti Industries Limited ::</title>
<style type="text/css"><!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div align="center">
<table background="images/spacer.gif" border="0" cellpadding="0" cellspacing="0" width="960"><!--DWLayoutTable-->
<tbody>
<tr>
<td colspan="3" height="13" valign="top">
<table background="images/home_02.jpg" border="0" cellpadding="0" cellspacing="0" width="959"><!--DWLayoutTable-->
<tbody>
<tr>
<td height="13" valign="top" width="959"><img alt="" height="13" src="images/home_02.jpg" width="959" /></td>
</tr>
</tbody>
</table>
</td>
<td width="1"></td>
</tr>
<tr>
<td rowspan="2" valign="top" width="314">
<table background="images/spacer.gif" border="0" cellpadding="0" cellspacing="0" width="314"><!--DWLayoutTable-->
<tbody>
<tr>
<td height="177" valign="top" width="314"><img alt="" border="0" height="177" src="images/home_04.jpg" usemap="#Map2" width="314" /></td>
</tr>
</tbody>
</table>
</td>
<td colspan="2" height="120" valign="top">
<table background="images/home_05.jpg" border="0" cellpadding="0" cellspacing="0" width="645"><!--DWLayoutTable-->
<tbody>
<tr>
<td height="120" valign="top" width="645">
<div class="navigation"><a class="active" href="index.html">Home</a>|<a class="main" href="about_us.html">About Us</a>|<a class="main" href="product.html"> Products</a>|<a class="main" href="member.html">Member</a>|<a class="main" href="investors.html">Investors</a>|<a class="main" href="career.html">Career</a>|<a class="main" href="contact.html">Contact</a></div>
</td>
</tr>
</tbody>
</table>
</td>
<td></td>
</tr>
<tr>
<td rowspan="2" valign="top" width="594">
<table bgcolor="#FBF1D8" border="0" cellpadding="0" cellspacing="0" width="594"><!--DWLayoutTable-->
<tbody>
<tr>
<td height="224" valign="top" width="594">
<div><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" height="219" width="594"><param name="movie" value="homebanner.swf" /><param name="quality" value="high" /><embed height="219" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" src="homebanner.swf" type="application/x-shockwave-flash" width="594"></embed></object></div>
</td>
</tr>
</tbody>
</table>
</td>
<td rowspan="2" valign="top" width="51">
<table background="images/spacer.gif" border="0" cellpadding="0" cellspacing="0" width="51"><!--DWLayoutTable-->
<tbody>
<tr>
<td height="224" valign="top" width="51"><img alt="" height="224" src="images/home_07.jpg" width="51" /></td>
</tr>
</tbody>
</table>
</td>
<td height="57"></td>
</tr>
<tr>
<td rowspan="2" valign="top">
<table background="images/home_08.jpg" border="0" cellpadding="0" cellspacing="0" width="314"><!--DWLayoutTable-->
<tbody>
<tr>
<td class="marquee" height="544" valign="top" width="314"><marquee behavior="alternate" direction="down" height="540" scrollamount="4" style="height: 540px;">
<p><img border="1" height="169" src="images/1999-00.jpg" style="margin-bottom:10px" width="225" /><br />
3rd Highest Capacity utilization in Soya Industry in year 1999-2000</p>
<p><img border="1" height="169" src="images/2001-02.jpg" style="margin-bottom:10px" width="225" /><br />
2nd Highest Capacity utilization in Soya Industry in year 2001-2002</p>
<p><img border="1" height="169" src="images/2002-03.jpg" style="margin-bottom:10px" width="225" /><br />
3rd Highest Capacity utilization in Soya Industry in year 2002-2003</p>
<p><img border="1" height="169" src="images/2003-04.jpg" style="margin-bottom:10px" width="225" /><br />
3rd Highest Capacity utilization in Soya Industry in year 2003-2004</p>
<p><img border="1" height="169" src="images/2004-05.jpg" style="margin-bottom:10px" width="225" /><br />
3rd Highest Capacity utilization in Soya Industry in year 2004-2005</p>
</marquee></td>
</tr>
</tbody>
</table>
</td>
<td height="167"></td>
</tr>
<tr>
<td colspan="2" height="377" valign="top">
<table background="images/home_09.jpg" border="0" cellpadding="0" cellspacing="0" width="645"><!--DWLayoutTable-->
<tbody>
<tr>
<td height="377" valign="top" width="645">
<div class="style2">
<p class="style3"><strong>Welcome to the DJ Parivaar!</strong><br />
<strong>Welcome to the Soy Shed!</strong></p>
<p>We are Central India's trusted Soybean processing Industry engaged in processing Soybean to extract valuable Soy Oil and Soymeal along with other valuable by-products like Lecithin, Acid Oil and Soy Deo Distillate.</p>
<p>With the experience of more than a decade in the processing of Soybean, we at Divya Jyoti master the art of growth fixation. In the year 1995, we started with a set-up of 300 TPD Solvent Extraction Plant with a vision to establish long term business relations with esteemed companies by supplying them crude Soy oil & Soy meal. Today Divya Jyoti has a 700 TPD Solvent extraction plant and a 100 TPD state of the art Refinery. Our growth rate is a combined team effort and is result of technically sound infrastructure, ultra-modern machinery, hi-tech laboratory, skilled manpower, hygienic storage space & above all the dedication and experience to meet the deadlines with the assurance of quality.</p>
<p>Reliability, flexibility, competitive pricing and prompt services have been pillars of company’s reputation and success. This is also reflected in the high level of customer satisfaction, which is driving force behind the company’s growth.</p>
</div>
</td>
</tr>
</tbody>
</table>
</td>
<td></td>
</tr>
<tr>
<td colspan="3" height="61" valign="top">
<table background="images/spacer.gif" border="0" cellpadding="0" cellspacing="0" width="959"><!--DWLayoutTable-->
<tbody>
<tr>
<td height="61" valign="top" width="959"><img border="0" height="61" src="images/home_10.jpg" usemap="#Map" width="959" /></td>
</tr>
</tbody>
</table>
</td>
<td></td>
</tr>
</tbody>
Try
<marquee direction="down" height="540" scrollamount="4" style="max-height:540px;">

min-height css is not working in outlook 2007 newsletter

i have made a newsletter in html with inline css and its working fine but when we are seeing it in outlook its not looking good and there are some css missing.its working fine with all other like gmail.
Here is the link for that html template:
http://fashionfad.in/newsletter/april-29/
Outlook is one of the mail services with the poorest support for css styles. Here you have a list of supported styles in different mail clients. I can't find min-height support, but from what I see, min-width and max-width are also not supported.
Min-height is not supported. Instead set your table cell height="" to the minimum and it will stretch larger if needed:
<!-- this has height set to 100, but stretches larger vertically -->
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
<tr>
<td valign="top" height="100">
Table 1<br>...<br>...<br>...<br>...<br>...<br>...<br>...<br>...<br>...<br>...
</td>
</tr>
</table>
<br><br>
<!-- this has height set to 100, faking "min-height" -->
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
<tr>
<td valign="top" height="100">
Table 1<br>...
</td>
</tr>
</table>
Alternatively if you are clever with your table nesting, you can fake min-height. This is better when you don't want to set a specific height on your cells, allowing the height to be controlled by the content instead:
<!-- this has no "min-height" -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
<tr>
<td valign="top">
Table 1<br>...<br>...<br>...<br>...<br>...<br>...<br>...<br>...
</td>
</tr>
</table>
</td>
<td valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#999999">
<tr>
<td valign="top">
Table 2<br>...<br>...<br>...<br>...
</td>
</tr>
</table>
</td>
</tr>
</table>
<br><br>
<!-- this fakes "min-height" -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
<tr>
<td valign="top">
Table 1<br>...<br>...<br>...<br>...<br>...<br>...<br>...<br>...
</td>
</tr>
</table>
</td>
<td valign="top" bgcolor="#999999">
Table 2<br>...<br>...<br>...<br>...
</td>
</tr>
</table>

HTML Email - Aligning content vertically

I'm new to this forum and I apologise in the advance in case this question has already been solved somewhere else, I couldn't really find anything helpful.
I'm coding a simple HTML template to be used on a dynamic platform where my clients can add the content by themselves.
The template has 3 stories on the bottom part which must stay vertically alined no matter how long is the content of each story.
Ideally I would need the longer story to determinate the height of the entire block.
No problem so far.
The problems comes because due to the dynamic platform I need to keep the content of a single story within a specific dynamic tag and at the same time I need to find a way where the longest story determinate the height of the other two stories.
EDIT Just to clarify: I need the "Read More" cell to be always alined to the bottom, the top picture always alined to the top while the title and the description cells height might vary.
here is the structure of my code. I would be very grateful to any suggestions.
<table width="650" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<DYNAMIC TAG>
<table width="195" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/image.jpg"/></td>
</tr>
<tr>
<td>Title </td>
</tr>
<tr>
<td>Text</td>
</tr>
<tr>
<td>Read More</td>
</tr>
</table>
</DYNAMIC TAG>
</td>
<td width="22"> </td>
<td width="195" valign="top">
<DYNAMIC TAG>
<table width="195" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/image.jpg"/></td>
</tr>
<tr>
<td>Title </td>
</tr>
<tr>
<td>Text</td>
</tr>
<tr>
<td>Read More</td>
</tr>
</table>
</DYNAMIC TAG>
</td>
<td width="23"> </td>
<td width="195" valign="top">
<DYNAMIC TAG>
<table width="195" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/image.jpg"/></td>
</tr>
<tr>
<td>Title </td>
</tr>
<tr>
<td>Text</td>
</tr>
<tr>
<td>Read More</td>
</tr>
</table>
</DYNAMIC TAG>
</td>
</tr>
</table>
I hope I was clear and everything make sense, and I tank you already for your help.
Have a lovely day,
Eleonora.
Ultimately the stories can only be as long as the content itself, but a table row will keep all cells in that row the same height:
<table width="600" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="200" bgcolor="#858585" valign="top">Section 1
</td>
<td width="200" bgcolor="#656565" valign="top">Section 2
</td>
<td width="200" bgcolor="#454545" valign="top">Section 3<br>
This sets the height of all 3.<br>...<br>...<br>...<br>...
</td>
</tr>
</table>
You are currently nesting a table inside each of these table cells - the table is independent so they will expand as needed, causing 3 tables with different heights. This would be invisible unless you were adding a background color or border to the table. In that case, instead of applying it to the nested table, apply it to the parent table cells.
If you want all content to 'float' at the bottom of the equal height table cells, change the valign attribute for each cell to valign="bottom"
UPDATE:
Thanks for the clarification - The issue is that you want to valign to the top and bottom within the same cell, which can't be done. Forcing 100% height isn't really supported either, so nesting a 100% height table with 2 rows (content then read me) won't work.
There are 2 ways I can think of (besides setting a fixed heights). One is pretty straight forward, and one is more out-the-box thinking.
Method 1:
<table width="600" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="200" bgcolor="#858585" valign="top">Section 1<br>...<br>...<br>...
</td>
<td width="200" bgcolor="#656565" valign="top">Section 2<br>...<br>...
</td>
<td width="200" bgcolor="#454545" valign="top">Section 3<br>
This sets the height of all 3.<br>...<br>...<br>...<br>...<br>
</td>
</tr>
<tr>
<td width="200" bgcolor="#858585" valign="top">Read More
</td>
<td width="200" bgcolor="#656565" valign="top">Read More
</td>
<td width="200" bgcolor="#454545" valign="top">Read More
</td>
</tr>
</table>
Drawback with this method is that your read me links are not immediately following the story in the code.
Method 2:
<table width="600" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="200" bgcolor="#858585" valign="top">Section 1<br>...<br>...<br>...
</td>
<td width="400" valign="top" rowspan="2">
<table width="400" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="200" bgcolor="#656565" valign="top">Section 2<br>...<br>...
</td>
<td width="200" valign="top" rowspan="2">
<table width="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="200" bgcolor="#454545" valign="top">Section 3<br>
This sets the height of all 3.<br>...<br>...<br>...<br>...<br>
</td>
</tr>
<tr>
<td width="200" bgcolor="#454545" valign="bottom">Read More
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="200" bgcolor="#656565" valign="bottom">Read More
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="200" bgcolor="#858585" valign="bottom">Read More
</td>
</tr>
</table>
The tables are nested so that they are driven by the 'grandchild' or a pre-determined biggest. Drawback is that this only works if you know which section is going to be the largest. The way this particular example is set up, the third table needs to have more content than the first two, but you could alternatively build it with either other section being the 'always biggest'.
I'm sure neither option is ideal, but unfortunately that is the best you can do with the limitations of cross-client supported html-email.

any suggestions on this css print problem

I have this code on my print.css:
#header, #tae, #nav, .noprint {display: none;}
width: 100%; margin: 0; float: none;
In order not to display the elements within those div tags. But I don't know with the code below why it isn't cooperating. If I place the div tags on it. And then I hit the print button. I see no output.
Here it is:
<div id="tae">
<table border="0" align="center" cellpadding="0" cellspacing="0" class="bg1">
<tr>
<td class="text1" style="height: 50px;">xd627 information management system</td>
</tr>
<tr>
<td class="bg5"><table border="0" cellspacing="0" cellpadding="0" style="height: 62px; padding-top: 15px;">
<tr align="center">
<td>Homepage</td>
<td>Database</td>
<td>About</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top" class="bg6"> </td>
</tr>
<tr>
<td><table width="780" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<td width="20"> </td>
<td width="297"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/spacer.gif" alt="" width="30" height="30" /></td>
</tr>
</tr>
<tr>
<td class="text2">
</div>
<div id="max">
<?php
//some php code in here showing a mysql table.
?>
</div>
What's wrong with my code? Does the php script depend on the one where I put the div tag in?
What do I do? All I want to show up in my page when printed is the mysql table. I'm using
Universal Document Converter to simulate printing.
The HTML in that snippet is broken and the entire document is contained in #tae, thus nothing will print as everything is in a container that is display: none;
Here's a cleaned up version of that markup.
<div id="tae">
<table border="0" align="center" cellpadding="0" cellspacing="0" class="bg1">
<tr>
<td class="text1" style="height: 50px;">xd627 information management system</td>
</tr>
<tr>
<td class="bg5">
<table border="0" cellspacing="0" cellpadding="0" style="height: 62px; padding-top: 15px;">
<tr align="center">
<td>Homepage</td>
<td>Database</td>
<td>About</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" class="bg6"> </td>
</tr>
<tr>
<td>
<table width="780" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<td width="20"> </td>
<td width="297">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<img src="images/spacer.gif" alt="" width="30" height="30" />
</td>
</tr>
<tr>
<td class="text2"></td>
</tr>
<!-- All this is missing, from here... -->
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<!-- ...to here. -->
<div id="max">
<?php
//some php code in here showing a mysql table.
?>
</div>

Resources