Table has some tr with bigger height - html

As you can see in this fiddle
Fiddle
The table starts with all the rows having the same height but later they have bigger heights, why is that?
This is just some portion of the table, please check the fiddle
<table border="2" cellpadding="0" cellspacing="0"
height="190">
<tbody>
<tr bgcolor="#ffffcc">
<td class="Normal" style="width: 116px;"
height="16" valign="top">
<p style="" align="center"><strong><font
face="Arial, Helvetica, sans-serif" size="2">
<span
style="font-size: 10pt; font-family: Arial; color: blue"> <font
color="#000066"> FECHA</font></span></font></strong></p>
</td>
<td class="Normal" height="16" valign="top"
width="90">
<p style="" align="center"><strong><font
face="Arial, Helvetica, sans-serif" size="2">
<span
style="font-size: 10pt; font-family: Arial;"> <font
color="#000066">Número</font></span></font></strong></p>
</td>
<td colspan="3" class="Normal" height="16"
valign="top" width="357">
<p style="" align="center"><strong><font
color="#990000" face="Arial, Helvetica, sans-serif"
size="2"><span
style="font-size: 10pt; font-family: Arial; color: blue"> <font
color="#000066">Variaciones</font></span></font></strong></p>
</td>
</tr>
<tr>
<td class="Normal" style="width: 116px;"
height="22" valign="top">
<div align="center"></div>
</td>
<td class="Normal" bgcolor="#ffffcc"
height="22" valign="top" width="90">
<p style="" align="center"><strong><font
color="#000066" face="Arial, Helvetica, sans-serif"
size="2"><span
style="font-size: 10pt; font-family: Arial; color: blue">Indice</span></font></strong></p>
</td>
<td class="Normal" bgcolor="#ffffcc"
height="22" valign="top" width="357">
<p style="" align="center"><strong><font
color="#000066" face="Arial, Helvetica, sans-serif"
size="2"><span
style="font-size: 10pt; font-family: Arial; color: blue">Mensual</span></font></strong></p>
</td>
<td class="Normal" bgcolor="#ffffcc"
height="22" valign="top" width="357">
<p style="" align="center"><strong><font
face="Arial, Helvetica, sans-serif" size="2">
<span
style="font-size: 10pt; font-family: Arial; color: blue">Acum.
del Año</span></font></strong></p>
</td>

This happens because some TD tags have P tags inside them. Use span instead.
Do this:
<tr>
<td class="Normal" style="width: 116px;" height="13" valign="top">
<span style="" align="center"><strong style="font-weight: 400;"><font face="Arial, Helvetica, sans-serif" size="2">
<span style="font-family: Arial;">31/01/<a name="2009">2009</a></span></font></strong></span>
</tr>
Instead of:
<tr>
<td class="Normal" style="width: 116px;" height="13" valign="top">
<p style="" align="center"><strong style="font-weight: 400;"><font face="Arial, Helvetica, sans-serif" size="2">
<span style="font-family: Arial;">31/01/<a name="2009">2009</a></span></font></strong></p>
</td>
</tr>

The reason why the row with 28/02/2009 and the rows below that are higher is very simple:
in the rows above 28/02/2009, the first table cell has no <p> element;
in the row with 28/02/2009 and those below it, the first table cell has a <p> element.
I assume that the HTML code was created in a WYSIWYG editor; that would explain why it is so bloated. The code can be made much smaller by removing all direct formatting from the HTML code and replacing it with CSS style rules. By direct formatting, I mean things like
align="center" height="1" valign="top" width="90" on the <td> elements,
style="font-weight: 400;" on the <strong> elements inside the <td> elements,
the entire <span style="font-size: 8.5pt; font-family: Tahoma;">...</span> elements,
the entire <font face="Arial" size="2">...</font> elements (except for their content, obviously).
You would then end up with something like the following:
<tr>
<th>28/02/2009</th>
<td>113,59</td>
<td>0,57</td>
<td>6,81</td>
<td>14,56</td>
</tr>
Then, you need to make up your mind about the font face, the font size, etc., because some of the direct formatting was contradictory (Tahoma on the span elements, Arial on font elements, ...) and create CSS rules for the table.

I would just use css to set the height of the tr elements:
tr {
height: 40px; /* or whatever else */
}
EDIT: you can also try setting the height of td:
td {
height: 40px;
}

Related

Why is there white space between the elements in my <div> container?

I'm very new to HTML, and I've built a custom HTML email signature. I want it to look like this:
However, with my code below, the three strings I'm grouping next to each other end up with white space between the first and subsequent strings as shown below
What is a proper way to group the three strings together without getting a gap between elements?
<div class="presentational-container">
<table role="presentation" cellpadding="0" cellspacing="0" border="0"style="background: none;margin: 0;padding: 10px 10px 0;border-width: 1px 0 0 0;border-style: solid;border-color: #F2F2F2;">
<tbody>
<tr class="outer-row" style="padding: 0 12px 0 0;">
<td class="headshot-cell" style="text-decoration: none;vertical-align: middle;width: 72px;padding: 0 6px 0 0;">
<a href="http://www.robertcooper.me">
<img src="https://tetonsports.imagerelay.com/ql/6cde221aa42c4ec8b325b3c0f6235d2e/email-icon-01.png" name="preview-image-url" style="vertical-align: middle;width:72px"/>
</a>
</td>
<td class="description-cell">
<table role="presentation">
<tbody>
<tr>
<td colspan="2" class="company" style="font-weight: normal;color: #000001;font-size: 14px;font-family: Helvetica, Geneva, sans-serif;">TETON Sports</td>
</tr>
<tr>
<div>
<td colspan="2" class="name" style="font-weight: bold;color: #000001;font-size: 14px;font-family: Helvetica, Geneva, sans-serif;">Josh Jorgensen</td>
<td colspan="2" class="divider" style="font-weight: bold;color: #FF9E18;font-size: 14px;font-family: Helvetica, Geneva, sans-serif;">//</td>
<td colspan="2" class="title" style="font-style: italic;font-weight: normal;color: #54565A;font-size: 14px;font-family: Helvetica, Geneva, sans-serif;">Photographer</td>
</div>
</tr>
<tr>
<td valign="top" class="website" style="font-style: italic;font-weight: normal;color: #54565A;font-size: 14px;font-family: Helvetica, Geneva, sans-serif;">
josh#tetonsports.com
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
Those three text parts are in separate table cells, and these tablecells even have colspan="2". So these are aligned with the table cells of the rows above and below which also have colspan="2".
I would either put all three in one cell, or at least remove the colspan="2" from them and add colspan="3" to the cells below and above, since all rows should have the same amount of cells for lining up properly.

Why does the embedded image in my email signature not obey its width styling in Outlook on Windows?

I've created a custom HTML email signature with an embedded image. The end result in Komodo previewer and Apple Mail client looks like this
However, once I bring the same HTML code into the Outlook desktop app on a Windows PC the signature renders like this
It seems like Outlook is ignoring the width styling entirely.
How do I get correct sizing of my embedded image in Outlook?
<table cellpadding="0" cellspacing="0" border="0"style="background: none;margin: 0;padding: 40px 10px 30px;">
<tbody>
<tr style="padding: 0 12px 0 0;">
<td style="vertical-align: middle;width: 50px;padding: 0 6px 0 0;">
<a href="http://www.tetonsports.com">
<img src="https://tetonsports.imagerelay.com/ql/6cde221aa42c4ec8b325b3c0f6235d2e/email-icon-01.png" name="preview-image-url" style="vertical-align: middle;width:69px"/>
</a>
</td>
<td>
<table>
<tbody>
<tr>
<td style="font-weight: normal;color: #000001;font-size: 14px;font-family: Helvetica, Geneva, sans-serif;">TETON Sports</td>
</tr>
<tr>
<div>
<td
<span style="font-weight: bold;color: #000001;font-size: 14px;font-family: Helvetica, Geneva, sans-serif;">Josh Jorgensen</span>
<span style="font-weight: bold;color: #FF9E18;font-size: 14px;font-family: Helvetica, Geneva, sans-serif;">//</span>
<span style="font-style: italic;font-weight: normal;color: #54565A;font-size: 14px;font-family: Helvetica, Geneva, sans-serif;">Photographer</span>
</td>
</div>
</tr>
<tr>
<td valign="top" style="font-style: italic;font-weight: normal;color: #54565A;font-size: 14px;font-family: Helvetica, Geneva, sans-serif;">
<a style="text-decoration: none;font-style: italic;font-weight: normal;color: #54565A;" href="brandon#tetonsports.com">josh#tetonsports.com</a>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
Have you tried using the width HTML attribute of the <img> tag like this: width="69"?
Here's the whole tag:
<img src="https://tetonsports.imagerelay.com/ql/6cde221aa42c4ec8b325b3c0f6235d2e/email-icon-01.png" name="preview-image-url" style="vertical-align: middle;" width="69"/>

Email template padding not aligned

I'm trying to send email newsletters, and the padding are all wrong on outlook. here is my code:
<div style="height: 600px; overflow:hidden;">
<table style="width: 520px;" cellspacing="0" cellpadding="0" border="0" align="center">
<tbody>
<tr>
<td width="500">
<table style="width: 250px;" cellspacing="0" cellpadding="0" border="0" align="left">
<tbody>
<tr>
<td>
<p style="font-family: Helvetica Neue, Arial; font-size: 12px; line-height: 1.5; color: #cccccc; margin: 0px;"><i>bla bla | adadadsd</i></p>
</td>
</tr>
<tr>
<td><img createnew="true" src="https://multimedia.getresponse.com/getresponse-zMTNQ/photos/563de7a4-ca7d-462a-88be-1cd31ef21fc4.jpg" style="padding-bottom:10px;" width="250" height="250"></td>
</tr>
<tr>
<td>
<h3 style="font-family: Helvetica Neue, Arial; font-size: 18px; line-height: 1.5; color: #194845; margin: 0px; mso-line-height-rule:exactly;">adad is the way to go!</h3>
</td>
</tr>
<tr>
<td>
<p style="font-family: Helvetica Neue, Arial; font-size: 12px; color: #c69a5b; margin: 0px;">................</p>
</td>
</tr>
<tr>
<td height="27"><img createnew="true" src="http://newsletter.etiketa-dev.xyz/nl-27/linetitle.png" width="53" height="6"></td>
</tr>
<tr>
<td valign="top" height="139">
<p style="font-family: Helvetica Neue, Arial; font-size: 14px; line-height: 1.5; color: #222222; margin: 0px;">ajksdhajkh ajhdkajhd hdkahdkahdkah hdkahdkahdkja adajhdakjdkahd asdadhkad ahdkahdkadhkadha Obradovic. Uadd has been certified adad APP, and is ready to implement best practice on all 3244 projects.
</p>
</td>
</tr>
<tr>
<td>
<img createnew="true" src="http://newsletter.etiketa-dev.xyz/nl-27/cta1.jpeg" style="padding-top:6%;" width="250" height="60">
</td>
</tr>
</tbody>
</table>
<table style="width: 250px;" cellpadding="0" border="0" align="right">
<tbody>
<tr>
<td>
<p style="font-family: Helvetica Neue, Arial; font-size: 12px; line-height: 1.5; color: #cccccc; margin: 0px; text-decoration:none; margin:0;"><i>adad | asda.org</i></p>
</td>
</tr>
<tr>
<td><img createnew="true" src="https://multimedia.getresponse.com/getresponse-zMTNQ/photos/a6042f20-f80a-4826-830b-eb482d49280c.jpg" width="250" height="250"></td>
</tr>
<tr>
<td>
<h3 style="font-family: Helvetica Neue, Arial; font-size: 18px; line-height: 1.5; color: #194845; margin: 0px;mso-line-height-rule:exactly;">adadd in Eastern Europe</h3>
</td>
</tr>
<tr>
<td>
<p style="font-family: Helvetica Neue, Arial; font-size: 12px; color: #c69a5b; margin: 0px;">adad leads in asdasdad the asdad adada!</p>
</td>
</tr>
<tr>
<td height="27"><img createnew="true" src="http://newsletter.etiketa-dev.xyz/nl-27/linetitle.png" width="53" height="6"></td>
</tr>
<tr>
<td valign="top" height="139">
<p style="font-family: Helvetica Neue, Arial; font-size: 14px; line-height: 1.5; color: #222222; margin: 0px;">jahdajkd adwrkjq akjdadka ajdajhd akjdkhr wrwr wrwrakn kajdalkjd jakljdaljd akljdjeor kadjlqldm lajkdjojd akljd jdks ks akdj of 2019!</p>
</td>
</tr>
<tr>
<td>
<img createnew="true" src="http://newsletter.etiketa-dev.xyz/nl-27/cta1.jpeg" style="padding-top:4%;" width="250" height="60">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
The button on the right ends up higher than the one on the left. How would you make them aligned on outlook?
I've tried replacing margin's with padding's but still no lock. I used % instead of px too.
It looks fine when i view it on a browser too.
Email development is NOT html development. Your web browser supoorts a different set of features than an email client like IOS, Gmail, Outlook and others, even if you view your emails through that web browser.
Outlook has spotty support for padding.
https://www.campaignmonitor.com/css/box-model/padding/
padding-top does not work at all with Outlook 2013-2019. Move the padding off the images and into the parent td.
<tr>
<td style="padding: 10px 0 0 0;">
<a href="https://adad.co/2019/03/29/well-is-the-way-to-go/" target="_blank">
<img createnew="true" src="http://newsletter.etiketa-dev.xyz/nl-27/cta1.jpeg" style="padding-top:6%;" width="250" height="60"></a>
</td>
</tr>
In addition, Outlook has spotty support for % values. I used a padding of 10px instead.
Last, Outlook 2007-2019 is never going to support Helvetica Neue, since it's a webfont and it has spotty support for webfonts with a space in the name. Arial is not a good fallback. Consider something like Trebuchet MS instead.
Good luck.

Why the HTML Text in Rich Content is showing image as 'Graphic'?

I am working on one project where I want to reassign a html text to a rich text control which is designed for web. This rich text control support html doc to display the record.
I am facing problem while uploading html with images as follows:
<font size=2 color="#000000" face="Arial">
<div>
<span style="font-size: 9pt; font-family: 'arial'; color: #000000;">Test Embedded Image </span>
<span style="font-size: 8pt; font-family: 'Arial'; color: #000000;">graphic</span>
</div>
<div>
<span style="font-size: 9pt; font-family: 'arial'; color: #000000;">Text after image sd</span>
<div><table width=538 border=1 cellpadding=0 bordercolor="#414141" cellspacing=0>
<tr valign=top>
<td width=180 valign=top><font size=2 color="#000000" face="Arial">
<div>
<span style="font-size: 9pt; font-family: 'arial'; color: #000000;">test </span>
</div>
</font>
</td>
<td width=178 valign=top><font size=2 color="#000000" face="Arial">
<div>
<img src="Image_1.PNG" width="166" height="238" border="0" alt="graphic"/>
</div>
</font>
</td>
<td width=178 valign=top><font size=2 color="#000000" face="Arial">
<div>
<img src="Image_2.PNG" width="166" height="238" border="0" alt="graphic"/>
</div>
</font>
</td>
</tr>
<tr valign=top>
<td width=180 valign=top><font size=2 color="#000000" face="Arial">
<div>
<img src="Image_3.PNG" width="166" height="238" border="0" alt="graphic"/>
</div>
</font>
</td>
<td width=178 valign=top><font size=2 color="#000000" face="Arial">
<div>
<span style="font-size: 8pt; font-family: 'Arial'; text-decoration: underline; color: #0066cc;"> xxx</span>
</div>
</font>
</td>
<td width=178 valign=top><font size=2 color="#000000" face="Arial">
<div>
<span style="font-size: 8pt; font-family: 'Arial'; text-decoration: underline; color: #0066cc;"> Web URL</span>
</div>
</font>
</td>
</tr>
</table>
</div>
But the images are replaced with the graphic text as shown in fig.
Can anyone tell me why this is happening?
The alt tag in img is set as graphic. It will show only if those images can't be found.Check the images if they are in right directory.
It's working in the FIDDLE here.

html tables & inline styles

I don't have a lot of experience with HTML tables and in-line CSS, but I'm trying to create an HTML email signature. Ideally, I'd like to have a small image on the left, text in the center, and a larger logo on the right, with a line of text centered below everything.
I have the basic content in, however I've tried to align everything with floats which don't seem to be working. What's the best way to have everything lined up in order horizontally?
jsfiddle
<br />
<meta name="format-detection" content="telephone=no">
<table width='600' id="sig" cellspacing='0' cellpadding='0' border-spacing='0' style="margin:0;padding:0;">
<tr>
<td width="47" style="float:left;width:47px;margin:0;padding:0;">
<img src="http://lorempixel.com/47/43/" alt="First Last" style="border:none;width:47px;">
</td>
<td width="10" style="width:10px;"> </td>
<td valign='top' style="margin:0;padding:0;">
<table id="sig2" cellspacing='0' cellpadding='0' border-spacing='0' style="float:left;padding:0;margin:0;font-family:'Gill Sans', 'Gill Sans MT', Calibri, sans-serif;font-size:13px;color:#D31145;border-collapse:collapse;-webkit-text-size-adjust:none;">
<tr style="margin:0;padding:0;color:#000104;">
<td style="margin:0;padding-left:8px;font-family:'Gill Sans', 'Gill Sans MT', Calibri, sans-serif;font-size:16px;white-space:nowrap;"><a style="border:none;text-decoration:none;color:#D31145;" href="mailto:email#example.com">FIRST LAST</a>
</td>
</tr>
<tr style="margin:0;padding:0;color:#000104;">
<td style="margin:0;padding-left:8px;font-family:'Gill Sans', 'Gill Sans MT', Calibri, sans-serif;font-size:16px;white-space:nowrap;">
<span style="border:none;text-decoration:none;color:#000104;">REALTOR | P <a style="border:none;text-decoration:none;color:#000104;" href="tel:1111111111">111.111.1111</a></span>
</td>
</tr>
<td width="177" style="float:right;width:177px;margin:0;padding:0;">
<img src="http://lorempixel.com/177/54/" alt="ZOPA Realty Group" style="border:none;width:177px;">
</td>
</table>
<table width='600' id="sig" cellspacing='0' cellpadding='0' border-spacing='0' style="margin:-15 0 0 60;padding:0;">
<tr>
<td><span style="margin:0;padding-left:8px;font-size:7px;font-family:'Gill Sans', 'Gill Sans MT', Calibri, sans-serif;color:#000104;white-space:nowrap;">BRE xxxxxxxx | Broker BRE xxxxxxxx. In association with Keller Williams. Each Keller Williams Realty office is independently owned and operated.</span></td>
<br />
Forget float, margin and html 3/5. The mail is very obsolete. You need do all with table.
One line = one table. You need margin or padding ? Do another column.
Codepen
Example : i need one line with
1 One Picture of 40*40
2 One margin of 10 px
3 One text of 400px
I start my line :
<table style=" background-repeat:no-repeat; width:450px;margin:0;" cellpadding="0" cellspacing="0" border="0">
<tr style="height:40px; width:450px; margin:0;">
<td style="height:40px; width:40px; margin:0;">
<img src="" style="width=40px;height40;margin:0;display:block"
</td>
<td style="height:40px; width:10px; margin:0;">
</td>
<td style="height:40px; width:400px; margin:0;">
<p style=" margin:0;"> my text </p>
</td>
</tr>
</table>
This should do the trick:
<table width="400" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="50" height="40" valign="top" rowspan="3">
<img alt="" src="" width="40" height="40" style="margin: 0; border: 0; padding: 0; display: block;">
</td>
<td width="350" height="40" style="font-family: Helvetica, Arial, sans-serif; font-size: 14px; color: #000000;">
LAST FIRST<br>
REALTOR | P 123.456.789
</td>
</tr>
<tr>
<td width="350" height="70" valign="bottom" style="font-family: Helvetica, Arial, sans-serif; font-size: 14px; color: #000000;">
<img alt="" src="" width="200" height="60" style="margin: 0; border: 0; padding: 0; display: block;">
</td>
</tr>
<tr>
<td width="350" height="20" valign="bottom" style="font-family: Helvetica, Arial, sans-serif; font-size: 10px; color: #000000;">
all your minor text here | all your minor text here | all your minor text here
</td>
</tr>
</table>
UPDATE: Adjusted code per the comments:
After viewing your jsFiddle, an important thing to note about tables is that table cell widths in each additional row all have to be the same width as the first, and all cells must add to the total width of your table.
Here is an example that will NOT WORK:
<table width="600" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="200" bgcolor="#252525">
</td>
<td width="400" bgcolor="#454545">
</td>
</tr>
<tr>
<td width="300" bgcolor="#252525">
</td>
<td width="300" bgcolor="#454545">
</td>
</tr>
</table>
Although the 2nd row does add up to 600, it (and any additional rows) must have the same 200-400 split as the first row, unless you are using colspans. If you use a colspan, you could have one row, but it needs to have the same width as the cells it is spanning, so this works:
<table width="600" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="200" bgcolor="#252525">
</td>
<td width="400" bgcolor="#454545">
</td>
</tr>
<tr>
<td width="600" colspan="2" bgcolor="#353535">
</td>
</tr>
</table>
Not a full tutorial, but I hope that helps steer you in the right direction in the future.
Here is the code you are after:
<table width="900" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="57" height="43" valign="top" rowspan="2">
<img alt="Rashel Adragna" src="http://zoparealtygroup.com/wp-content/uploads/2013/10/sig_head.png" width="47" height="43" style="margin: 0; border: 0; padding: 0; display: block;">
</td>
<td width="843" height="43" style="font-family: Helvetica, Arial, sans-serif; font-size: 14px; color: #000000;">
RASHEL ADRAGNA<br>
REALTOR | P 855.900.24KW
</td>
</tr>
<tr>
<td width="843" height="64" valign="bottom" style="font-family: Helvetica, Arial, sans-serif; font-size: 14px; color: #000000;">
<img alt="Zopa Realty Group logo" src="http://zoparealtygroup.com/wp-content/uploads/2013/10/sig_logo.png" width="177" height="54" style="margin: 0; border: 0; padding: 0; display: block;">
</td>
</tr>
<tr>
<td width="843" colspan="2" height="20" valign="bottom" align="center" style="font-family: Helvetica, Arial, sans-serif; font-size: 10px; color: #000000;">
all your minor text here | all your minor text here | all your minor text here
</td>
</tr>
</table>
You'll note that I've added an extra 10px to some of your table cells. This in combination with align/valigns act as padding between your cells. It is a clever way to aviod actually having to add padding, margins or empty padding cells.