Outlook 2007 and 2010 table cell formatting lost with long content - outlook

The set up:
<table width="600" >
<tr>
<td width="400" rowspan="2" valign="top">
With very long content here*
</td>
<td width="200" valign="top">
Top-aligned content
</td>
</tr>
<tr>
<td valign="bottom">
*Bottom-aligned content loses vertical alignment
and appears as if valign="middle"
</td>
</tr>
</table>
Example code is in jsfiddle as it is too long (lots of content needed to trigger the bug).
So see these:
http://jsfiddle.net/webhelpla/XZyg2/ sent as an email looks OK
http://jsfiddle.net/webhelpla/XZyg2/1/ sent as an email: bottom-aligned content is not bottom-aligned anymore.
Any ideas and experience with workarounds for this?

try adding vertical-align:bottom; as well,
<td valign="bottom" style='vertical-align:bottom;' >
*Bottom-aligned content loses vertical alignment
and appears as if valign="middle"
</td>
try this fiddle. i removed the rowspan=2 from the td, always use cellpadding in place of that.

Add table-layout:fixed to the css for the table and see if that helps. Coder1984 is correct in adding the "style=" tag inside the td since some email clients do better with that....
At any rate, it is very hard to predict how html email will render in various clients. I use email on acid to check rendering in a wide range of clients, from webmail through email clients to mobile....

Outlook has an issue with content of blocks over a certain size (2300px if I remember correctly). You may be able to avoid the issue with a third cell in your right-hand row:
<table width="600" >
<tr>
<td width="400" rowspan="3" valign="top">
With very long content here*
</td>
<!-- Add minimal heights to force the middle row to take the space -->
<td width="200" valign="top" height="1">
Top-aligned content
</td>
</tr>
<tr><td style="page-break:always"><!-- Let's make a page break *here* --></td></tr>
<tr>
<td valign="bottom" height="1">
*Bottom-aligned content loses vertical alignment
and appears as if valign="middle"
</td>
</tr>
</table>

Related

Failure to render B64encoded Thymeleaf

I have searched many hours on here and across the Internet an am unable to render a properly B64 encoded image in an object. I have tried every permutation of diacriticals and nothing. Can someone inform the correct
<tr th:each="re:${reorderList}">
<td th:text="${re.invoiceNum}"></td>
<td th:text="${re.ordered}"></td>
<td th:text="${re.shipped}"></td>
<td th:text="${re.sku}"></td>
<td ><img th:src="${'data:image/jpg;base64,'+ re.upc_s" ></td>
<td th:text="${re.upc01_s}"></td>
<td th:text="${re.brand}"></td>
<td th:text="${re.desc}"></td>
<td th:text="${re.stdCost}"></td>
</tr>
You're missing the ending curly brace in the th:src attribute of your <img /> tag. The expression should be:
th:src="${'data:image/jpg;base64,'+ re.upc_s}"
I would personally represent this as:
<img th:src="|data:image/jpg;base64, ${re.upc_s}|" />

Making Link Description point to Link Reference in IMPORTXML statement

I am scraping FINVIZ financial data using the google sheets IMPORTXML function, specifically:
=IMPORTXML("http://finviz.com/quote.ashx?t="&B1,"//table[#id='news-table']/tr")
Against the following source:
<table width="100%" cellpadding="1" cellspacing="0" border="0" id="news-table" class="fullview-news-outer">
<tr>
<td width="130" align="right" style="white-space:nowrap">Feb-15-20 03:58PM </td>
<td align="left">U.S. Woman From Cruise Falls Ill as 2,200 Head Home: Virus Update <span style="color:#aa6dc0;font-size:9px">Bloomberg</span></td>
</tr>
<tr>
<td width="130" align="right">03:41PM </td>
<td align="left">Afraid of sky-high stock valuations? Consider this deep value strategy <span style="color:#aa6dc0;font-size:9px">MarketWatch</span></td>
</tr>
<tr>
<td width="130" align="right">10:47AM </td>
<td align="left">If you could buy only one stock for 5G and artificial intelligence, this would be it <span style="color:#aa6dc0;font-size:9px">MarketWatch</span></td>
</tr>
</table>
Hence, if I choose the stock ticker for Apple (AAPL) then the XPATH component of the IMPORTXML call above returns the following:
Question: How do I modify the XPATH component to make the news description clickable to its HREF?
I DO NOT want the URL to replace the news - just the news to point to its destination such that clicking the news takes me to the link.
try:
=ARRAYFORMULA({INDEX(IMPORTXML("http://finviz.com/quote.ashx?t="&B1,
"//table[#id='news-table']/tr"),,1),
HYPERLINK(IMPORTXML("http://finviz.com/quote.ashx?t="&B1,
"//table[#id='news-table']/tr//a/#href"),
INDEX(IMPORTXML("http://finviz.com/quote.ashx?t="&B1,
"//table[#id='news-table']/tr"),,2))})

Ruby fastest way to select button in large table

I'm trying to interact with a site that has a large table that looks something like this:
<table id="tblID" cellspacing="1" cellpadding="0" border="0" width="100%">
<tbody><tr valign="top" align="left">
<td colspan="6" height="10"></td>
</tr>
<tr><td bgcolor="#666666" height="1" colspan="6"><img src="img.gif" width="1" height="1" border="0"></td></tr>
<tr class="GridHeader" valign="top" align="left">
<td width="60"><b>Select</b></td>
<td width="210" colspan="2"><b>Account Type</b></td>
<td width="160" colspan="2"><b>Number</b></td>
<td width="200"><b>Account known as</b></td>
</tr>
<tr align="left" valign="middle">
<td class="normal"><input type="radio" id="radButton" name="radButton" value="1233399,1515636"></td>
<td class="normal">ACCTYPE</td>
<td class="normal" width="10"> </td>
<td class="normal">ACCNUMBER</td>
<td class="normal" width="10"> </td>
<td class="normal">ACCNAME</td>
</tr>
<tr align="left" valign="top">
<td height="1" colspan="6" bgcolor="#cccccc"><img src=".img.gif" width="1" height="1" border="0"></td>
</tr>
<tr align="left" valign="middle">
<td class="normal"><input type="radio" id="radButton" name="radButton" value="2263763,2777747"></td>
<td class="normal">ACCTYPE</td>
<td class="normal" width="10"> </td>
<td class="normal">ACCNUMBER</td>
<td class="normal" width="10"> </td>
<td class="normal">ACCNAME</td>
</tr>
This goes on for many hundreds of rows.
My code's aim is to search the rows based on ACCNUMBER, and select the associated radio button. My code does this, but takes a LONG time to do it.
my ruby code so far is this:
require 'watir'
require 'nokogiri'
html = browser.html
doc = Nokogiri::HTML(html)
*csv import and loop stuff*
bkacc = CSV[0]
*nokogiri go fast!*
rows = doc.css("table[id='tblID'] tbody tr")
rows.each do |row|
target = row.text[bkacc]
if !target.nil?
cells = row.css("td[class='normal']")
#pushme = cells[0].css('input')[0]['value']
end
end
*watir goes slow*
browser.table(:id,"tblMaintenance").tbody.trs(:valign,"middle").find do |tr|
temp = tr.td(index: 0).radio(:id => "radButton").attribute_value("value")
if temp == #pushme
tr.td(index: 0).radio(:id => "radButton").set
break
end
end
*other commands and loop to next line in csv*
The finding of the :value of the button I want to push is very fast with nokogiri, but once found, using that :value to look for and set the button with watir is very slow.
My question is; how can I speed this up? I thought perhaps by using mechanize I could but the syntax escapes me. I'm still very new to Ruby so am probably missing some basic knowledge.
Assuming that the combination of the id and value attribute is unique for each radio button, you could locate the radio button directly. The entire Watir loop could be replaced by just:
browser.radio(:id => "radButton", :value => #pushme).set
Alternatively, I would try replacing both loops with the following. Finding the row will be a touch slower than the Nokogiri approach, but the code would be a lot simpler.
row = browser.table(id: 'tblID').tr(text: /#{bkacc}/)
row.radio.set

Umbraco 7.3.1 CurrentPage.Children issue

Consider this code:
#inherits Umbraco.Web.Macros.PartialViewMacroPage
#{
var pages = #CurrentPage.Children;
}
<table style="width:100% !important">
<thead>
<tr>
<td>Subbasin Name</td>
<td style="width: 15% !important">Hydrologic Unit Code (HUC)</td>
<td style="width: 25% !important">TMDL Status</td>
<td style="width: 25% !important">Implementation Plan Status</td>
<td style="width: 15% !important">Five Year Review Status</td>
</tr>
</thead>
<tbody>
#foreach (var page in #pages){
<tr>
<td>#page.pageTitle <br />#page.watershedName</td>
<td>#page.hydrologicUnitCode</td>
<td>#page.tmdlStatus</td>
<td>#page.implementationPlanStatus</td>
<td>#page.fiveYearReviewStatus</td>
</tr>
}
</tbody>
</table>
Problem: The table draws and populates as desired but for one thing...
#page.pageTitle
The URL of each of the child pages isn't right.. each row of the table has the right Title, and the other columns are correct, but the anchor is being formed with the URL of the CurrentPage rather than each Child's .Url. I assume I am doing something wrong, but I cannot see why this isn't working.
Any suggestions?
Thanks!
Found my problem - case sensitivity (duh).
Changing:
#page.pageTitle
to:
#page.pageTitle
fixes the problem.

HTML Table Button in Email Template

I'm trying to make a nice HTML button for my email (don't want to use images), and I took the initial design idea from Facebook, the button renders nicely in my browser, but not in Outlook. Does anyone know what I can do to fix it?
The design is on our site, and the code for the button is as follows:
<td valign='middle' style='width:92px;padding-left:0px;text-align:right;white-space:nowrap; !important'>
<div style='height:32px !important;'>
<a href='".site_url()."export/export_timesheet?id=".$timeID."' style='color:#3b5998;text-decoration:none;'>
<table cellspacing='0' cellpadding='0' width='100%' height='33' style='border-collapse:collapse;border-width:1px;border-style:solid;display:block;border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;font-size:14px;border-color:#2C729E;height:33px !important;'>
<tbody>
<tr><td height='7' colspan='3' style='line-height:7px;'> </td></tr>
<tr>
<td width='16' style='display:block;width:16px;'> </td>
<td width='100%' style='text-align:center;'><a href='".site_url()."export/export_timesheet?id=".$timeID."' style='color:#2C729E;text-decoration:none;display:block;'><center><font size='3'><span style='font-family:Helvetica Neue,arial,sans-serif;font-style:normal;white-space:nowrap;font-size:14px;'><strong>Get PDF</strong></span></font></center></a></td>
<td width='16' style='display:block;width:16px;'> </td>
</tr>
<tr><td height='7' colspan='3' style='line-height:7px;'> </td></tr>
</tbody>
</table>
</a>
</div>
</td>
But when it renders in Outlook it looks like this:
I don't care about the rounded edges, but I would like the height to work properly. Does anyone know how I can fix this? I've tried forcing the height with no luck.
Try this:
<table width="92" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="33" valign="middle" align="center" style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #2C729E; border:1px solid #2C729E;">
Get PDF
</td>
</tr>
</table>
I have the anchor tag on the text instead of around the <td> itself. It has been a long time since I tested it that way, so I just posted what I know works.
Also, you do know that javascript can't be used in html email right? You'll have to execute that stuff server side before sending.

Resources