Set table row content using CSS? - html

Can I somehow turn:
<!-- top blue line -->
<tr bgcolor="#000066">
<td width="120" valign="top" height="1"></td>
<td width="1" height="1"></td>
<td width="120" valign="top" height="1"></td>
<td width="1" height="1"></td>
<td width="120" valign="top" height="1"></td>
</tr>
into something more like:
<tr class="blueline"></tr>
and the CSS will take care of inserting all the <td>s?
If there's a logical and simple way of doing this in ASP.NET/C# where I keep the formatting in one central location I would be open to hearing it but I'd prefer to just use CSS if at all possible.
EDIT:
Based on the answers and comments I'll just post what I have for the nested tables which I like the look of and I guess if its best to use just go about it a totally different way that's fine; and as far as using a web control that might be the best idea but I'm not sure how to use a web control and then actually be able to put different content into sections of the web control as if it was a static html table. I need to be able to edit the middle section for the column names, textboxes, and datatypes.
Code:
<table width="362" border="0" cellspacing="0" cellpadding="0">
<!-- top blue line -->
<tr bgcolor="#000066">
<td width="120" valign="top" height="1"></td>
<td width="1" height="1"></td>
<td width="120" valign="top" height="1"></td>
<td width="1" height="1"></td>
<td width="120" valign="top" height="1"></td>
</tr>
<!-- top white space -->
<tr>
<td width="120" valign="top" height="10"></td>
<td width="1" height="10"></td>
<td width="120" valign="top" height="10"></td>
<td width="1" height="10"></td>
<td width="120" valign="top" height="10"></td>
</tr>
<!-- middle row / content -->
<tr>
<!-- Labels for columns go inside this td -->
<td width="120" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr valign="top">
<td>
<p align="left"><font color="#FFFFFF"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><font color="#000063">
ColumnNames
</font></font></b></font></p>
<!-- put labels in here -->
<p align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">
cell_id<br />
cell_description<br />
cell_name
</font></font></p>
</td>
</tr>
</table>
</td>
<td width="1" bgcolor="#FFCF63" height="1"></td>
<!-- textboxes go inside this td -->
<td width="120" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr valign="top">
<td>
<p align="left"><font color="#FFFFFF"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#000063">
Textboxes
</font></b></font></p>
<!-- put textboxes in here -->
<p><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<asp:TextBox ID="TextBox6" runat="server" Width="100px"></asp:TextBox><br />
<asp:TextBox ID="TextBox7" runat="server" Width="100px"></asp:TextBox><br />
<asp:TextBox ID="TextBox8" runat="server" Width="100px"></asp:TextBox>
</font></p>
</td>
</tr>
</table>
</td>
<td width="1" bgcolor="#FFCF63" height="1"></td>
<!-- datatypes for columns go inside this td -->
<td width="120" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr valign="top">
<td>
<p align="left"><font color="#FFFFFF"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><font color="#000063">
Data Types
</font></font></b></font></p>
<!-- put datatype descriptions [varchar(50),int,etc] in here -->
<p align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">
INT<br />
VARCHAR(50)<br />
VARCHAR(10)
</font></font></p>
</td>
</tr>
</table>
</td>
</tr>
<!-- bottom white space -->
<tr>
<td height="10"></td>
<td height="10" width="1"></td>
<td height="10"></td>
<td height="10" width="1"></td>
<td height="10"></td>
</tr>
<!-- bottom blue line -->
<tr bgcolor="#000066">
<td width="120" valign="top" height="1"></td>
<td width="1" height="1"></td>
<td width="120" valign="top" height="1"></td>
<td width="1" height="1"></td>
<td width="120" valign="top" height="1"></td>
</tr>
</table>

I would suggest writing a single javascript function for this and that function can be invoked on any page that you desire. This will reduce the need to write redundant code everywhere and make updates easier.

The CSS will apply to every page that references the css file unless it is specifically overridden in that page. You would move all your styling to the css file and basically have as little as possible in the table layout. Keep in mind that tables are best used for tabular data like reports. If you are using nested tables to handle positioning then this can be better accomplished through css and div tags.

CSS can't add td's into a tr so you won't be able to take that approach. You could use jquery/javascript to implement this but if you can use asp/c# there is something called a web user control that can hold html and you just have to put one line of code on your actual page to pump in the table.

For this particular example, it sounds like a top border on either the table or the first non-header row would be perfect. Assuming a table somewhat like:
<table>
<thead>
<tr>
<th>Some Column</th>
<th>Some Other Column</th>
</tr>
</thead>
<tbody>
<!-- rows go here -->
</tbody>
</table>
, you could just use a quick:
tbody tr:first-of-type {
border-top: 1px solid blue;
}

CSS Can't do what you have described.
However, if you refactor your markup to use tables correctly, what you want is pretty simple. Nested tables are very rarely warranted.
/*Set Basic font styles for table*/
#data {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
/*Provides the border and spacing*/
padding: 20px 0;
border-top: 1px solid #006;
border-bottom: 1px solid #006;
}
/*Give the table headers a bit of color*/
#data th {
color: #000063;
text-align: left;
font-size: 13px;
}
/*set the width of our cells*/
#data th,
#data td {
width: 120px;
}
/*Add some right padding to the first colum*/
#data tr>th:first-of-type,
#data tr>td:first-of-type {
width: 114px;
padding-right: 6px;
}
/*Add some left padding to th last colum*/
#data tr>th:last-of-type,
#data tr>td:last-of-type {
width: 114px;
padding-left: 6px;
}
/*Set the input width*/
#data input[type="text"] {
width: 100px;
}
<table border="0" cellspacing="0" cellpadding="0" id="data">
<thead>
<tr>
<th>Column Names</th>
<th>Textboxes</th>
<th>Data Types</th>
</tr>
</thead>
<tbody>
<tr>
<td>cell_id</td>
<!-- Replace input tags with your asp:textbox control -->
<td><input type="text" /></td>
<td>INT</td>
</tr>
<tr>
<td>cell_description</td>
<td><input type="text" /></td>
<td>VARCHAR(50)</td>
</tr>
<tr>
<td>cell_description</td>
<td><input type="text" /></td>
<td>VARCHAR(10)</td>
</tr>
</tbody>
</table>

Related

HTML email table buttons

I have been trying to update our email from using a bunch of images to just code but I'm hitting an issue with using tables. I can't seem to get the 's to be as narrow as I need them to be. All I want is to have them be fairly close to each other and aligned left. I've never worked with tables before, but I read up on them and everything seems to be correct but nothings working. Any suggestions on what I need to edit? PS This will be seen a lot on Outlook so that is a big factor.
http://codepen.io/Mdadedesign/pen/qavwkg
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
<tr style='mso-yfti-irow:4;mso-yfti-lastrow:yes; background-color:pink; width:300px'>
<td width="90" style="background-color:lightblue;">
<table width="90" style="float:left;">
<tr>
<td>
<table border="0" align="center" cellpadding="0" cellspacing="0" style="margin:0 auto;">
<tbody>
<tr>
<td align="center">
<table border="0" cellpadding="0" cellspacing="0" style="margin:0 auto;">
<tr>
<td align="left" bgcolor="#075aa0" width="90" style="-moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; padding: 5px;width: 90px;display: block;text-decoration: none;text-align: center;font-weight: bold;font-size: 11.5px;font-family: sans-serif;color: #ffffff;border: 1px solid red;line-height:15px;">
<a href="http://premierdisability.com/" style="text-decoration:none;color:#fff;">
Android App
</a>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</td>
<td width="70" style="background-color:cornsilk;">
<table width="70" style="float:left;">
<tr>
<td>
<table border="0" align="center" cellpadding="0" cellspacing="0" style="margin:0 auto;">
<tbody>
<tr>
<td align="center">
<table border="0" cellpadding="0" cellspacing="0" style="margin:0 auto;">
<tr>
<td align="center" bgcolor="#075aa0" width="70" style="-moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; padding: 5px;width: 90px;display: block;text-decoration: none;text-align: center;font-weight: bold;font-size: 11.5px;font-family: sans-serif;color: #ffffff;border: 1px solid red;line-height:15px;">
<a href="http://premierdisability.com/" style="text-decoration:none;color:#fff;">
Apple App
</a>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</td>
<td width="70" style="background-color:lightblue;">
<table width="70" style="float:left;">
<tr>
<td>
<table border="0" align="center" cellpadding="0" cellspacing="0" style="margin:0 auto;">
<tbody>
<tr>
<td align="center">
<table border="0" cellpadding="0" cellspacing="0" style="margin:0 auto;">
<tr>
<td align="left" bgcolor="#075aa0" width="90" style="-moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; padding: 5px;width: 90px;display: block;text-decoration: none;text-align: center;font-weight: bold;font-size: 11.5px;font-family: sans-serif;color: #ffffff;border: 1px solid red;line-height:15px;">
<a href="http://premierdisability.com/" style="text-decoration:none;color:#fff;">
Refer A Friend
</a>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</td>
</tr>
You're talking about the three buttons at the bottom, the "Android App", "Apple App" and "Refer a friend", right?
If you look at the styles you have, you have both a width set on the table, and a width in px set in the style for each button. Not that much to be done with the total width, really, but you can change the first one from 90px to 70px, the second one from 90px to 60px, and the last one from 90px to 80px. If you want to make them smaller than that, you'll have to put them under eachother, or reduce the size of the text and the clickable area.

Why does IE render this HTML table differently?

I'm trying to put together a simple HTML email using old school coding standards and I've hit a brick wall that I didn't foresee. Internet Explorer, even IE 11, renders a simple table differently to every other browser I've tried (Chrome, Firefox, Safari) and I can't figure out why.
In terms of layout, it should look like this (note: colours are for illustration only -- apologies to your eyes!):
But in IE it looks like this:
The HTML is pretty simple:
<table border="0" cellpadding="0" cellspacing="0" width="650" bgcolor="ffffff">
<tr>
<td bgcolor="#ff0000" valign="top" height="250" width='30' rowspan="3">
Height: 250px
</td>
<td background="images/top_2_2a.gif" bgcolor="#00ff00" valign="top" width="455" height="42">
Height: 42px
</td>
<td background="images/top_2_3a.gif" bgcolor="#0000ff" valign="top" width="135" height="116" rowspan="2">
Height: 116px
</td>
<td bgcolor="#ff00ff" valign="top" height="250" width='30' rowspan="3">
Height: 250px
</td>
</tr>
<tr>
<td background="images/top_2_2b.gif" bgcolor="#00ffff" valign="top" width="455" height="208" rowspan="2">
<div>
<div style="font-size:43px; color:#000; font-family: arial; vertical-align: bottom">
Height: 208px
</div>
</div>
</td>
</tr>
<tr>
<td background="images/top_2_3b.gif" bgcolor="#ffff00" valign="top" width="135" height="134">
<div>
<div style="padding-bottom:0px;font-size:13px; color:#000; vertical-align: bottom;font-family: arial">
Height: 134px
</div>
</div>
</td>
</tr>
</table>
JSFiddle: http://jsfiddle.net/mCLDh/
Am I doing something wrong, or is IE still messing with me after all these years?
(Note: For the commenters who are unaware, you cannot use floats or absolute positioning in HTML emails. That's why I'm using code that looks like it came from 1998. It's ugly, but it's more supported by email clients.)
What you are experiencing is the rowspan version of the Outlook issue pointed out here.
Nested tables are the logical choice, however, you can get your code working by adding empty cells on the left to enforce the row heights, making Outlook behave as expected.
<table border="0" cellpadding="0" cellspacing="0" width="650" bgcolor="ffffff">
<tr>
<td bgcolor="#ff0000" valign="top" height="42" width='0'><!-- Empty cell for outlook -->
</td>
<td bgcolor="#ff0000" valign="top" height="250" width='30' rowspan="3">
Height: 250px
</td>
<td background="images/top_2_2a.gif" bgcolor="#00ff00" valign="top" width="455" height="42">
Height: 42px
</td>
<td background="images/top_2_3a.gif" bgcolor="#0000ff" valign="top" width="135" height="116" rowspan="2">
Height: 116px
</td>
<td bgcolor="#ff00ff" valign="top" height="250" width='30' rowspan="3">
Height: 250px
</td>
</tr>
<tr>
<td bgcolor="#ff0000" valign="top" height="74" width='0'><!-- Empty cell for outlook -->
</td>
<td background="images/top_2_2b.gif" bgcolor="#00ffff" valign="top" width="455" height="208" rowspan="2">
<div>
<div style="font-size:43px; color:#000; font-family: arial; vertical-align: bottom">
Height: 208px
</div>
</div>
</td>
</tr>
<tr>
<td bgcolor="#ff0000" valign="top" height="134" width='0'><!-- Empty cell for outlook -->
</td>
<td background="images/top_2_3b.gif" bgcolor="#ffff00" valign="top" width="135" height="134">
<div>
<div style="padding-bottom:0px;font-size:13px; color:#000; vertical-align: bottom;font-family: arial">
Height: 134px
</div>
</div>
</td>
</tr>
</table>
Your best bet is nested tables
http://jsfiddle.net/3L8qL/1/
like so
<table border="0" cellpadding="0" cellspacing="0" width="650" bgcolor="ffffff">
<tr>
<td bgcolor="#ff0000" valign="top" height="250" width='30'>Height: 250px</td>
<td>
<table border="0" cellpadding="0" cellspacing="0" >
<tr>
<td background="images/top_2_2a.gif" bgcolor="#00ff00" valign="top" width="455" height="42">Height: 42px</td>
</tr>
<tr>
<td background="images/top_2_2b.gif" bgcolor="#00ffff" valign="top" width="455" height="208" >
<div>
<div style="font-size:43px; color:#000; font-family: arial; vertical-align: bottom">Height: 208px</div>
</div>
</td>
</tr>
</table>
</td>
<td>
<table border="0" cellpadding="0" cellspacing="0" >
<tr>
<td background="images/top_2_3a.gif" bgcolor="#0000ff" valign="top" width="135" height="116" >Height: 116px</td>
</tr>
<tr>
<td background="images/top_2_3b.gif" bgcolor="#ffff00" valign="top" width="135" height="134">
<div>
<div style="padding-bottom:0px;font-size:13px; color:#000; vertical-align: bottom;font-family: arial">Height: 134px</div>
</div>
</td>
</tr>
</table>
</td>
<td bgcolor="#ff00ff" valign="top" height="250" width='30'>Height: 250px</td>
</tr>
</table>
Edit:
Here's why the browser was confused.
You have created a table with 3 total rows. The sum height of all three rows is 250px.
In the second column, the first row is 42px, and the sum of the bottom two is 208px
In the third column, the first two rows is 116px, and the third row is 134px.
Which means that (table wide) the first row is defined at 42px, the third row is at 134px but the middle row is ambiguous at 166px, 92px, AND -18px at the same time.
Tables are meant to be tabular, but when you break the nature of the table, it's a crap shoot on what you'll get.
Ok, since you stated that it will be used for a html e-mail: do NOT use colspan, rowspan. split the table up in: (not it is NOT pretty but it will save you a metric shit-ton of problems)
<table>
<tr>
<td>
250px
</td>
<td>
<table>
<tr>
<td>
height 42px
</td>
</tr>
<tr>
<td>
height 208px
</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>
height 116px
</td>
</tr>
<tr>
<td>
height 134px
</td>
</tr>
</table>
</td>
<td>
250px
</td>
</tr>
</table>
(correct me if this can be done more easy, and yes, the inner tables can be replaced with divs.)
oh, and a shout out to ZURB for coming up with INK: http://zurb.com/ink/ (saved me heaps of trouble)
Interesting, must be minimum size thing, because if you make that value larger, it will render the same as others -- try 200 for example. But, IE doesn't make it smaller since it wants it to be the same height (or larger) than the next column.

HTML Emails - Outlook 2007/2010 border collapse/spacing issue

So, I'm having issues with Outlook 2007/2010 spacing (border collapse?) issue.
Here is an image as to what it is doing (the Hurry Now.. text gets pushed down)
Here is what it is supposed to look like & works fine in all other email clients.
Here is my snippet of code for the Hero section
<table cellpadding="0" cellspacing="0" width="561" align="center" bgcolor="#4b88cf" style="font-family: Tahoma, Arial, Verdana, sans-serif; font-size:40px; font-weight:normal; line-height:40px; text-align:left; color:#ffffff; border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tr>
<td width="561" height="37" style="font-size: 0; line-height: 0" bgcolor="#4b88cf"> </td>
</tr> <!-- end spacer -->
<tr>
<td height="48" valign="top" style="color: #ffffff;"><font color="#ffffff">Save 10% on all</font></td>
</tr> <!-- heading -->
<tr>
<td height="48" valign="top" style="color: #ffffff;"><font color="#ffffff">EasyACCT 2013 products.</font></td>
</tr> <!-- heading -->
<tr>
<td height="48" valign="top" style="color: #ffffff;"><font color="#ffffff">Only 4 days left!</font></td>
</tr> <!-- heading -->
<tr>
<td width="561" height="25" style="font-size: 0; line-height: 0" bgcolor="#4b88cf"> </td>
</tr> <!-- spacer here -->
<!-- start button -->
<tr>
<td>
<table cellpadding="0" cellspacing="0" align="left" style="font-family: Tahoma, Arial, Verdana, sans-serif; font-size:14px; font-weight:normal; line-height:20px; text-align:left; color:#ffffff; border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tr>
<td style="border-collapse: collapse;"><img src="http://intuit.pistonclients.com/13-intu-r-1629/images/left-btn.png" border="0" style="display: block;" alt="left side button"/></td> <!-- left side button -->
<td align="center" style="font-weight: bold; border-collapse: collapse;" bgcolor="#f0640f"><font color="#ffffff" style="text-decoration: none;">Renew Now to Save 10%</font></td>
<td style="border-collapse: collapse;"><img src="http://intuit.pistonclients.com/13-intu-r-1629/images/right-btn.png" border="0" style="display: block;" alt="right side button"/></td> <!-- right side button -->
</tr>
</table>
</td>
</tr>
<!-- end button -->
<tr>
<td width="561" height="15" style="font-size: 0; line-height: 0; border-collapse: collapse;" bgcolor="#4b88cf"> </td>
</tr> <!-- spacer here -->
<tr>
<td valign="top" width="561" style="font-size: 18px; color: #ffffff; border-collapse: collapse;"><font color="#ffffff">Hurry, offer ends October 31!</font><sup style="font-size: 12px; line-height: 0; vertical-align: 8px"><font color="#ffffff">1</font></sup></td>
</tr>
<tr>
<td width="561" height="23" style="font-size: 0; line-height: 0; border-collapse: collapse;" bgcolor="#4b88cf"> </td>
</tr> <!-- spacer here -->
</table>
This is a problem I've come across with Outlook 2007,2010 and of course 2013. They don't like small cells.
I've found this code has worked for me and gone through Litmus tests.
<tr height="1">
<td width="482" height="1" align="left" valign="top" background="#000000" style="background:#000000;font-size: 1px; line-height: 0px; mso-line-height-rule: exactly;"> </td>
</tr>
The mso-line-height-rule: exactly; is an outlook specific style. The font-size: 1px should match however much height you want your cell to be. The line-height: 0px; zero's out any line-height space.
HOWEVER, after testing your code snippet with the updated cells this doesn't seem to be the actual problem. I made the spacer cells black so I could better see what was actually going on.
The black spacer cell ends well above the copy, ie. it's not pushing your text down. The issue is actually the cell with the white copy in it.
I added a line height to the cell and removed the border-collapse:collapse; (you don't need it on individual cells. You may just want to double check your superscripts are all good.
<tr>
<td valign="top" width="561" style="font-size: 18px; line-height: 20px; color: #ffffff;"><font color="#ffffff">Hurry, offer ends October 31!<sup style="font-size: 12px; line-height: 0; vertical-align: 8px"><font color="#ffffff">1</font></sup></font></td>
</tr>
This was the result:
Hope that helps.
Outlook has a minimum cell height of 19px, so the 15px cell you have as the spacer in seems to be expanding, evern though you have the font-size and line-height zero'd out.
An alternative way to do it, is instead of having your text sandwiched between two spacer rows, make 1 taller row and vertically center it instead:
<tr>
<td valign="middle" width="561" height="50" style="font-size: 18px; color: #ffffff; border-collapse: collapse;"><font color="#ffffff">Hurry, offer ends October 31!</font><sup style="font-size: 12px; line-height: 0; vertical-align: 8px"><font color="#ffffff">1</font></sup></td>
</tr>
Throughout your whole email, you don't really need separate rows for each line of text, just use <br> instead to separate the rows.
I agree with John. Just use the breaks to create vertical whitespace. You're making it more difficult for yourself, without any reason :-)
Just put the right attributes at their right place: your use of the font-tag is overwhelming, as is the border-collapse:collapse and the font-size:0; line-height:0;.
If you want to create a whitespace, give a height at the TD (20px) and style="font-size:20px; line-height:20px;", with a BR-tag inside (no nbsp).
See my example:
<table cellpadding="0" cellspacing="0" border="0" width="561" align="center" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tr><td bgcolor="#4b88cf" align="left" style="font-family:Tahoma, Arial, Verdana, sans-serif; font-size:40px; line-height:46px; color:#ffffff;"><br />Save 10% on all<br />EasyACCT 2013 products.<br />Only 4 days left!<br /><br /></td></tr>
<tr><td bgcolor="#4b88cf"><table cellpadding="0" cellspacing="0" border="0" align="left"><tr>
<td width="12" height="50" bgcolor="#f0640f"><img src="http://intuit.pistonclients.com/13-intu-r-1629/images/left-btn.png" width="12" height="50" alt="" border="0" style="display:block;" /></td>
<td bgcolor="#f0640f" align="center" style="font-family:Tahoma, Arial, Verdana, sans-serif; font-size:14px; line-height:20px; color:#ffffff;"><strong style="color:#ffffff;">Renew Now to Save 10%</strong></td>
<td width="14" bgcolor="#f0640f"><img src="http://intuit.pistonclients.com/13-intu-r-1629/images/right-btn.png" width="14" height="50" alt="" border="0" style="display:block;" /></td>
</tr></table></td></tr>
<tr><td bgcolor="#4b88cf" style="font-family:Tahoma, Arial, Verdana, sans-serif; font-size:18px; line-height:20px; color:#ffffff;"><br />Hurry, offer ends October 31!<sup style="font-size:12px; line-height:0; vertical-align:8px">1</sup><br /><br /></td></tr></table>

Table's border-right doesn't show in email template when viewed in Outlook

I have gone through a lot of threads, but I couldn't find something helpful. If that's a duplicate please point me to the relevant thread.
We have created a custom RSS feed for one of our websites in order to achieve the design we wanted for the template. I have managed to make it look good almost everywhere expect Outlook, which is a pain!
The main problem I'm facing is that I cannot show the right border in one of my boxes.
Please refer to the attached screenshot.
Here's my HTML. I have also tried by using percentages for the widths, but didn't work either.
<table width="525" height="250" border="0" cellpadding="0" cellspacing="0" bgcolor="#fafafa" class="main-content" style="border:1px solid #ccc;">
<tr>
<td width="50"><!-- --></td>
<td width="284" align="left" valign="middle"><img src="'.site_url().'/wp-content/uploads/'.$image.'" width="274" height="196" mc:edit="Box_image_2" mc:allowdesigner alt="" /></td>
<td width="20"><!-- --></td>
<td width="280" valign="top" >
<table width="220" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="15"><!-- --></td>
</tr>
<tr>
<td align="left" class="body-text-bold" style="font-size:16px;font-weight:bold;" mc:edit="body_bold_text" mc:allowdesigner="mc:allowdesigner" ><strong>'.$deal['post_title'].'</strong></td>
</tr>
<tr>
<td height="16"><!-- --></td>
</tr>
<tr>
<td><!-- Red Box Start -->
<div class="red-box" style="background:#e9e9e9;border:1px solid #ccc;">
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="5"><!-- --></td>
</tr>
<tr>
<td width="7"><!-- --></td>
<td width="120" class="white-box" style="background:#ffffff;border:1px solid #ccc;">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="5"><!-- --></td>
</tr>
<tr>
<td width="30"></td>
<td align="left" class="red-box-text" style="font-family:Arial, Helvetica, sans-serif;font-size:18px;font-weight:bold;" mc:edit="top_box_price_1" mc:allowdesigner="mc:allowdesigner">Τιμή</td>
<td width="30"></td>
</tr>
<tr>
<td height="5"><!-- --></td>
</tr>
<tr>
<td width="25"></td>
<td align="center" class="red-box-text" style="font-family:Arial, Helvetica, sans-serif;font-size:18px;font-weight:bold;" mc:edit="top_box_price_2" mc:allowdesigner="mc:allowdesigner">'.$price.'€</td>
<td width="20"></td>
</tr>
<tr>
<td height="5"></td>
</tr>
</table>
</td>
<td width="5"><!-- --></td>
<td width="120" class="white-box" style="background:#ffffff;border:1px solid #ccc;">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="10"><!-- --></td>
</tr>
<tr>
<td width="25"></td>
<td align="left" class="red-box-text" style="font-family:Arial, Helvetica, sans-serif;font-size:18px;font-weight:bold;" mc:edit="top_box_discount_1" mc:allowdesigner="mc:allowdesigner">Έκπτωση</td>
<td width="30"></td>
</tr>
<tr>
<td height="5"><!-- --></td>
</tr>
<tr>
<td width="35"></td>
<td align="center" class="red-box-text" style="font-family:Arial, Helvetica, sans-serif;font-size:18px;font-weight:bold;" mc:edit="top_box_discount_2" mc:allowdesigner="mc:allowdesigner">'.$discount.'</td>
<td width="5"></td>
</tr>
<tr>
<td height="15"></td>
</tr>
</table>
</td>
<td width="5"><!-- --></td>
<td></td>
</tr>
<tr>
<td height="5"><!-- --></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td height="12"><!-- --></td>
</tr>
<tr>
<td align="left" class="body-text-bold" mc:edit="body_bold_text" mc:allowdesigner="mc:allowdesigner" ><!--REMOVED BY DUSTIN '.$deal['post_content'].'--></td>
</tr>
<tr>
<td height="0"><!-- --></td>
</tr>
<tr>
<td align="center" mc:edit="top_box_image" mc:allowdesigner="mc:allowdesigner" width="120px" style="background-color:#ac0003; color:#ffffff; border:1px solid #660b0e;cursor: pointer; display: block; font-family:Arial, Helvetica, sans-serif; font-size:12px; padding-top:5px; padding-bottom:5px; text-decoration:none; "><a style="color:#ffffff; text-decoration:none;" href="'.$deal['guid'].'" class="">Δες το Deal</a> </td>
</tr>
</table>
</td>
<td width="0"><!-- --></td>
</tr>
</table>
In case this helps: I send the email through MailChimp using FEED tag.
Thanks in advance for any help!
I think this issue is being caused by the widths of your table cells. Try setting the width twice for each table cell like this:
<td width="10" style="width:10px;">
Also add the following embedded styles:
table td {border-collapse: collapse;}
table { border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt; }
Tip:
You might want to specify what version of Outlook is causing problems. Outlook 2007/2010/2013 react totally different to the same styling than Outlook 2003/2011 for example.
Simply,you can't divide images vertically , if you then it will show 1px space--divide images horizontaly and try it. It will be solved

Not able to determine Font and style in a page

I have a page but I am not able to determine it''s font style. I checked the view source but nothing is visible. Some lines are commented. Please let me know how to determine the font name:
<html>
<!-- InstanceBegin template="/Templates/inner.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title></title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
background-color: #ECECEC;
}
.style2 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style3 {
font-family: "Arial Unicode MS";
font-size: 16px;
line-height: 30px;
color: #333333;
}
-->
</style>
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- InstanceBeginRepeat name="RepeatRegion1" -->
<!-- InstanceBeginRepeatEntry -->
<div align="center">
<!-- ImageReady Slices (Untitled-1) -->
<table id="Table_01" width="950" height="824" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="233" colspan="9"><img src="images/index_01.gif" width="950" height="233" alt=""></td>
</tr>
<tr>
<td height="57"><img src="images/index_02.gif" alt="" width="112" height="57" border="0"></td>
<td><img src="images/index_03.gif" alt="" width="87" height="57" border="0"></td>
<td colspan="2"><img src="images/index_04.gif" alt="" width="137" height="57" border="0"></td>
<td><img src="images/index_05.gif" alt="" width="161" height="57" border="0"></td>
<td><img src="images/index_06.gif" alt="" width="146" height="57" border="0"></td>
<td><img src="images/index_07.gif" alt="" width="130" height="57" border="0"></td>
<td><img src="images/index_08.gif" alt="" width="104" height="57" border="0"></td>
<td><img src="images/index_09.gif" alt="" width="73" height="57" border="0"></td>
</tr>
<tr>
<td colspan="3" valign="top" bgcolor="#FFFFFF"><img src="images/index_10.gif" width="232" height="507"></td>
<td height="307" colspan="6" valign="top" bgcolor="#FFFFFF">
<!-- InstanceBeginEditable name="EditRegion3" -->
<table width="716" height="493" border="0" cellpadding="0" cellspacing="0"><tr>
<td height="493" colspan="2" valign="top"><table width="719" height="529" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="74"><img src="images/parichaya.gif" width="600" height="93"></td>
</tr>
<tr>
<td valign="top"><table width="489" border="0" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
<td valign="top" class="style3">नाव</td>
<td valign="top" class="style3">श्री.शशिकांत जयवंतराव शिंदे</td>
</tr>
<tr>
<td> </td>
<td valign="top" class="style3">वडिलांचे नाव</td>
<td valign="top" class="style3">कै.जयवंतराव भाऊसाहेब शिंदे</td>
</tr>
<tr>
<td height="55"> </td>
<td valign="top" class="style3">आईचे नाव</td>
<td valign="top" class="style3">श्रीमती. कौशल्या भाऊसाहेब शिंदे</td>
</tr>
<tr>
<td> </td>
<td valign="top" class="style3">गाव</td>
<td valign="top" class="style3">हुमगाव, ता.जावली,जि.सातारा. <br>
बॉम्बे लिंक को-ऑप.हौसिंग सोसायटी,<br>
४ था मजला, सेक्टर नं.१७,<br>
वाशी, नवी.मुबंई ४००७०५</td>
</tr>
<tr>
<td> </td>
<td valign="top" class="style3">जन्म </td>
<td valign="top" class="style3">१९ ऑक्टोबर १९६३</td>
</tr>
<tr>
<td> </td>
<td valign="top" class="style3">जन्म ठिकाण</td>
<td valign="top" class="style3">हुमगाव, ता.जावली, जि.सातारा.</td>
</tr>
<tr>
<td> </td>
<td valign="top" class="style3">शिक्षण </td>
<td valign="top" class="style3">बी.कॉम.</td>
</tr>
<tr>
<td> </td>
<td valign="top" class="style3">न्यात भाषा </td>
<td valign="top" class="style3">मराठी, हिंदी व इंग्रजी.</td>
</tr>
<tr>
<td> </td>
<td valign="top" class="style3">पत्नीचे नाव </td>
<td valign="top" class="style3">सौ.तेजल शशिकांत शिंदे</td>
</tr>
<tr>
<td> </td>
<td valign="top" class="style3">अपत्ये </td>
<td valign="top" class="style3">तेजस, साहिल.</td>
</tr>
<tr>
<td width="24"> </td>
<td width="173" valign="top" class="style3">छंद</td>
<td width="270" valign="top" class="style3">शेती,दुग्धप्रक्रिया.<br><br>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr></table>
<!-- InstanceEndEditable -->
</td>
</tr>
<tr>
<td colspan="9" background="images/index_13.gif" height="103"> </td>
</tr>
<tr>
<td><img src="images/spacer.gif" width="112" height="1" alt=""></td>
<td><img src="images/spacer.gif" width="87" height="1" alt=""></td>
<td><img src="images/spacer.gif" width="33" height="1" alt=""></td>
<td><img src="images/spacer.gif" width="104" height="1" alt=""></td>
<td><img src="images/spacer.gif" width="161" height="1" alt=""></td>
<td><img src="images/spacer.gif" width="146" height="1" alt=""></td>
<td><img src="images/spacer.gif" width="130" height="1" alt=""></td>
<td><img src="images/spacer.gif" width="104" height="1" alt=""></td>
<td><img src="images/spacer.gif" width="73" height="1" alt=""></td>
</tr>
</table>
<!-- End ImageReady Slices -->
</div>
<!-- InstanceEndRepeatEntry -->
<!-- InstanceEndRepeat -->
</body>
<!-- InstanceEnd -->
</html>
the only text i see has style3
firebug will show it too you
it is 'Arial Unicode MS'
but why use .style3 in the css as selector when you can use:
table td{
font-family: "Arial Unicode MS";
font-size: 16px;
line-height: 30px;
color: #333333;
}
there is a style specified
.style2 {font-family: Verdana, Arial, Helvetica, sans-serif}
So i think it may be verdana.
But style2 is not specified anywhere style3 is defined for the td class so it might be Arial.
Use Firefox Addon - Firebug it will shows style sheets, js and also html
The styles being applied are these two ..
body {
background-color: #ECECEC;
}
.style3 {
font-family: "Arial Unicode MS";
font-size: 16px;
line-height: 30px;
color: #333333;
}
so the font-family is over-written by "Arial Unicode MS" ..
Observe everywhere style3 is being assigned as class to all the <td> tags and style2 is not being used anywhere ..
One thing you can do to get confirmed about my words .. Just delete .style2 .style3 and body styles in your code one by one and observe the changes in Browser ..
There are no lines commented .. To comment in CSS we use /* Comment line here*/ (for a quick reference) Here is a link for reference on comments
You should definitely use the Firebug plugin for Firefox.
Among other things it adds pect element" option to the contextmenu, so you can access all information by right-clicking an element.
If there is no font given via HTML and CSS, the displayed font will probably be your default browser/system font.
Do you mean programmatically via JavaScript, or using a browser tool?
Using a browser tool, the "computed styles" function in "inspect elements" in Firebug is a good bet, as the other answerers point out as well. It will give you something even if there was no font specified at all (in my case, "serif").
However, even the computed style gives you only the specified font-family and not the font actually used. As far as I know from my JavaScript attempts in that area, only IE returns those.
But I'm waiting for your reaction first before delving deeper into this - maybe the Firebug hint is already all you need.