NetSuite: FreeMarker List Getting Pushed Down - netsuite

I can't figure out why this list is getting pushed down? The list items start at the 4th row. I was hoping the <#compress> directive would truncate any white space but had no affect on the output.
blank line/white space
blank line/white space
blank line/white space
blank line/white space
Ice Cream $50.00
Vanilla
--next page--
Ice Cream $50.00
Chocolate
<hr
style="width: 100%; color: #d3d3d3; background-color: #d3d3d3; height: 1px;" />
<!-- start items -->
<#list record.item as item>
<table style="margin-top: 10px; width: 100%;">
<#if item.custcol_comments?contains("cream")>
<#compress>
<tr>
<td colspan="12" style="text-align: center;"><span
style="font-weight: bold; line-height: 10%; color: #333333;">${item.item}</span><br />${item.description}</td>
<td colspan="4" style="text-align: center;"> </td>
<td colspan="4" style="text-align: center;">${item.amount}</td>
</tr>
</#compress>
</#if>
</table>
</#list>
<!-- end items -->
<hr

You need to swap the order of the table and <#list> tags. What you are doing right now is creating a separate table for every line item, irrespective of whether or not it matches the condition.
<table style="margin-top: 10px; width: 100%;">
<#list record.item as item>
<#if item.custcol_comments?contains("cream")>
<tr>
<td colspan="12" style="text-align: center;"><span style="font-weight: bold; line-height: 10%; color: #333333;">${item.item}</span><br />${item.description}</td>
<td colspan="4" style="text-align: center;"> </td>
<td colspan="4" style="text-align: center;">${item.amount}</td>
</tr>
</#if>
</table>
</#list>
<#compress> will remove whitespace but not empty tables, but in any case the BFO renderer will automatically remove extra whitespace so it's not typically needed in NetSuite templates.

Related

TinyMCE paste from excel

I have a problem with TinyMCE editor which I cannot resolve.
If I copy a table from Excel and paste it into the editor it loses the formatting. I have set up extended_valid_elements as follows...
extended_valid_elements:"a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],table[style|class|border=2|width|cellspacing|cellpadding|bgcolor],colgroup,col[style|width],tbody,tr[style|class],td[style|class|colspan|rowspan|width|height|background|span|padding],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style|font-family|color]"
The HTML that is saved into the MySQL field is as follows
From Excel ...
<table style="border-collapse: collapse; width: 242pt;" border="2" width="322">
<tbody>
<tr style="height: 14.25pt;">
<td style="height: 14.25pt; width: 105pt;" width="140">Test</td>
<td style="width: 104pt;" width="138"></td>
<td style="width: 33pt;" width="44"> </td>
</tr>
</tbody>
</table>
From Word ...
<table style="width: 242.0pt; border-collapse: collapse;" border="2" width="0">
<tbody>
<tr style="height: 14.25pt;">
<td style="width: 105.0pt; padding: 0cm 5.4pt 0cm 5.4pt; height: 14.25pt;" width="140">
<p style="margin-bottom: .0001pt; line-height: normal;"><span style="font-size: 10.0pt; font-family: 'Arial',sans-serif; color: black;">Test</span></p>
</td>
<td style="width: 104.0pt; padding: 0cm 5.4pt 0cm 5.4pt; height: 14.25pt;" width="139"></td>
<td style="width: 33.0pt; background: #92D050; padding: 0cm 5.4pt 0cm 5.4pt; height: 14.25pt;" width="44">
<p style="margin-bottom: .0001pt; line-height: normal;"><span style="font-size: 10.0pt; font-family: 'Arial',sans-serif; color: black;"> </span></p>
</td>
</tr>
</tbody>
</table>
How can I make this work from excel without having to go through word first?
It would appear I have to use power paste which is a paid-for option ... I have a call setup with their sales team to see how much it will cost! Fingers crossed.

HTML table scraping - table object returned as 1 big cell instead of separate elements

I've been working on a webpage scraping program from within excel VBA (with lots of help from this forum).
I've gotten stuck at a table which shows a single row, which I need to automate clicking. I used the same method for a similar table earlier in the process and that worked fine:
setting the HTML table to IEtable object
using ietable.rows(1).click
This table however, returns as 1 cell containing the values of all the separate elements I see on the webpage and the .click function doesn't work.
This is the HTML code for the table I am trying to access:
<table id="tblPatientList" class="tblTabBody" style="height: 143px; width: 653px;" cellspacing="2" cellpadding="0">
<tbody>
<tr style="height: 100%; width: 100%;">
<td style="width: 649px; height: 100%;">
<div id="divPatientList" style="overflow: auto; width: 100%; height: 100%; background-color: white;">
<table id="dgrPatients" class="tblpat" style="border-width: 0px; width: 100%; border-collapse: collapse;" border="0" rules="all" cellspacing="0" cellpadding="1">
<tbody>
<tr class="headerBlue">
<td style="width: 5%;"> </td>
<td style="width: 15%;">Hosp No.</td>
<td style="width: 15%;">Surname</td>
<td style="width: 15%;">Forename</td>
<td style="width: 10%;">DOB</td>
<td style="width: 2%;">Sex</td>
<td style="width: 10%;">NHS Number</td>
<td style="width: 25%;">Address</td>
<td class="screenOnlyOutput" style="width: 5%;" align="center">List</td>
</tr>
<tr class="even" style="color: red;">
<td align="center"> </td>
<td><strong>12345678</strong></td>
<td>ANONYMOUS FIRST NAME</td>
<td>ANONYMOUS LAST NAME</td>
<td>dd/mm/yyyy</td>
<td align="center">M</td>
<td>123 456 7890 <img style="cursor: hand; vertical-align: middle; border: 0px;" title="Number present and verified" src="/icedesktop/dotnet/icedesktop/images/tick.gif" /></td>
<td>ANONYMOUS ADDRESS</td>
<td class="screenOnlyOutput" align="center"><input id="dgrPatients_ctl02_chkAddOrRemove" style="border: 0px; height: 12px;" name="dgrPatients$ctl02$chkAddOrRemove" type="checkbox" /></td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
This table always only returns 2 rows - a header and 1 data row. I try to click it with:
Set ieTbl = ieDoc.Document.frames(0).Document.all.tblPatientList
If Not ieTbl Is Nothing Then
ieTbl.Rows(1).Click
Set ieTbl = Nothing
End If
When I examine the ietable object in the immediate window, it only has 1 row and 1 column, containing all the separate cells on the html page in 1 cell in the ietbl object.
Why is it doing this?

How to get only rely content(black color) and not included quote(blue color) content using Selenium and Python

I want to know what to get some content not include quote content.
The following url is the target webpage:
https://forumd.hkgolden.com/view.aspx?type=BW&message=7219211
I must use a full xpath to get their content. I want to get black color content and I don't want to get blue content, but when I use the following code. I got blue and blank content together.
content = driver_blank.find_element_by_xpath('/html/body/form/div[5]/div/div/div[2]/div[1]/div[5]/table[8]/tbody/tr/td/table/tbody/tr/td[2]/table/tbody/tr[1]/td/div')
print(content.text)
The following is their html code:
<table width="100%" cellpadding="0" cellspacing="0" style="margin-bottom: 7px;">
<tbody>
<tr>
<td align="left">
<table class="repliers">
<tbody>
<tr hc7uwnfktbez9="" id="XoBTa" userid="461194" username="浅川梨奈">
<td class="repliers_left" style="background-color: #F3F2F1;">
<div>
<a name="275220714"></a>
<a href="javascript: ToggleUserDetail(6, 'XoBTa');" style="font-weight: bold; color: #FF0066;">
浅川梨奈
</a>
<br>
<br>
<div id="ThreadUser6" style="position: relative;">
<a href="/ProfilePage.aspx?userid=461194" style="text-decoration: none;">
<img src="/icons/97.gif" style="border-width: 0px;" alt="Logo">
</a>
<br>
<br>
<img src="/labels/4.gif" style="border-width: 0px;" alt="Member">
</div>
</div>
</td>
<td style="background-color: #F3F2F1; height: 100%; border: solid 1px #111111; vertical-align: top;">
<table class="repliers_right" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="vertical-align: top;">
<div class="ContentGrid">
<blockquote><div style="color: #0000A0;">有冇第隻款<img data-icons=":-[lm" src="/faces/lomore/angry.gif" alt=":-[lm"> <img data-icons=":-(lm" src="/faces/lomore/frown.gif" alt=":-(lm"> 我想要呢兩隻</div></blockquote>
<br>
係囉,反應好既會唔會考慮出其他?
<br>
我都想要其他
<img data-icons="^3^lm" src="/faces/lomore/kiss.gif" alt="^3^lm">
<img data-icons="[bomb]lm" src="/faces/lomore/bomb.gif" alt="[bomb]lm">
<br><br><br>
</div>
</td>
</tr>
<tr>
<td style="text-align: center; vertical-align: top;">
<div id="lineImage6" style="display: block; overflow: hidden;">
</div>
</td>
</tr>
<tr>
<td style="width: 100%; text-align: right;">
<div style="float: right; vertical-align: bottom; margin-top: 5px;">
<div id="lauming6" style="float: left; vertical-align: bottom;"></div>
<a class="btn btn_small btn_bookmark" href="Javascript:bookmarkThis(7219211)" id="laumingHref">留名</a>
<a class="btn btn_small btn_complain" href="contactus.aspx?messageid=7219211&replyid=275220714">投訴文章</a>
<a class="btn btn_small btn_quote" href="Javascript:QuoteReply(7219211,275220714);">快速引用</a>
<a class="btn btn_small btn_quote" href="post.aspx?mt=Y&rid=275220714&id=7219211&page=2">引用原文</a>
<span style="font-size: 12px; color:gray;">
15/4/2020 13:18
</span>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
I hope to use start-to, not, or contains instruction to finish it.
Can anyone help me? Thanks~~~

Building a Custom Report from a saved search using the "Advanced PDF/Template" Editor

I'm building a printable Report based off a saved search to group and subtotal multiple Lots and inventory Detail listing it under each item and displaying the subtotal below each group of items.
I can format the code properly to display 1 item at a time using this
<#if results?has_content>
<table class="itemtable" dir="ltr" style="width:100%;"><!-- start items --><#list results as result><tr>
<td style="width: 43px;"><span style="font-size:10px;">**</span></td>
<td colspan="2" rowspan="1" style="width: 70px;"><span style="font-size:10px;">${result.itemid}</span></td>
<td colspan="2" rowspan="1" style="width: 94px; white-space: nowrap;"><span style="font-size:10px;">${result.displayname}</span></td>
<td style="width: 133px;"> </td>
<td style="width: 72px;"> </td>
<td style="width: 47px;"> </td>
<td style="width: 120px;"> </td>
<td style="width: 79px;"> </td>
<td style="width: 68px;"> </td>
</tr>
<tr>
<td style="width: 43px;"><span style="font-size:10px;">${result.custitempacksize}</span></td>
<td style="width: 70px;"><span style="font-size:10px;">${result.custcol_lottextitemlinelevel}</span></td>
<td style="width: 48px;"><span style="font-size:10px;">${result.custitem_brand}</span></td>
<td style="width: 94px;">${result.expirationdate}</td>
<td style="width: 97px;"><span style="font-size:10px;">${result.serialnumbers}</span></td>
<td style="width: 133px;"><span style="font-size:10px;">${result.location}</span></td>
<td style="width: 72px;"><span style="font-size:10px;">${result.custbodyestimatedarrivaldate}</span></td>
<td style="width: 47px;"><span style="font-size:10px;">${result.rate}</span></td>
<td style="width: 120px;"><span style="font-size:10px;">${result.formulacurrency}</span></td>
<td style="width: 79px;"><span style="font-size:10px;">${result.quantityavailable}</span></td>
<td style="width: 68px;"><span style="font-size:10px;">${result.formulanumeric}</span></td>
</tr>
<tr>
<td style="width: 43px;">**</td>
<td colspan="3" rowspan="1" style="width: 70px;">Subtotal for : ${result.itemid}</td>
<td style="width: 97px;"> </td>
<td style="width: 133px;"> </td>
<td style="width: 72px;"> </td>
<td style="width: 47px;"> </td>
<td style="width: 120px;">
<hr />{subtotalEC}</td>
<td style="width: 79px;">
<hr />{subtotalLB}</td>
<td style="width: 68px;">
<hr />{subtotalCS}</td>
</tr>
</#list><!-- end items --></table>
</#if>
</body>
</pdf>
I'm on the right track to getting the results I want in the PDF but when I Attempt to add <#if> and <#else> tags to group the items It will save but then generate an Unexpected Error when I attempt to print it.
<pdf>
<head>
<link name="NotoSans" type="font" subtype="truetype" src="${nsfont.NotoSans_Regular}" src-bold="${nsfont.NotoSans_Bold}" src-italic="${nsfont.NotoSans_Italic}" src-bolditalic="${nsfont.NotoSans_BoldItalic}" bytes="2" />
<#if .locale == "zh_CN">
<link name="NotoSansCJKsc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKsc_Regular}" src-bold="${nsfont.NotoSansCJKsc_Bold}" bytes="2" />
<#elseif .locale == "zh_TW">
<link name="NotoSansCJKtc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKtc_Regular}" src-bold="${nsfont.NotoSansCJKtc_Bold}" bytes="2" />
<#elseif .locale == "ja_JP">
<link name="NotoSansCJKjp" type="font" subtype="opentype" src="${nsfont.NotoSansCJKjp_Regular}" src-bold="${nsfont.NotoSansCJKjp_Bold}" bytes="2" />
<#elseif .locale == "ko_KR">
<link name="NotoSansCJKkr" type="font" subtype="opentype" src="${nsfont.NotoSansCJKkr_Regular}" src-bold="${nsfont.NotoSansCJKkr_Bold}" bytes="2" />
<#elseif .locale == "th_TH">
<link name="NotoSansThai" type="font" subtype="opentype" src="${nsfont.NotoSansThai_Regular}" src-bold="${nsfont.NotoSansThai_Bold}" bytes="2" />
</#if>
<macrolist>
<macro id="nlheader">
${preferences.formlandscape}
<table class="header" style="width:100%;"><tr>
<td colspan="3" style="text-align: left; vertical-align: top; white-space: nowrap; height: 40px; width: 178px;"><span style="font-size:12px;"><strong>Date:</strong></span></td>
<td colspan="5" style="text-align: center; vertical-align: middle; white-space: nowrap; height: 40px; width: 400px;"><span style="font-size:12px;"><strong>Hofseth North America<br />In Stock Inventory Report sorted by Item<br />For All Items Available All Locations</strong></span></td>
<td colspan="3" style="text-align: right; vertical-align: top; white-space: nowrap; height: 40px;"><span style="font-size:12px;"><strong>Page:<pagenumber/> of <totalpages/></strong></span></td>
</tr></table>
<table boarder="1" class="header" style="width:100%;">
<thead>
<tr>
<th style="width: 40px;"><span style="font-size:12px;">Pack Size</span></th>
<th style="width: 55px;"><span style="font-size:12px;">Load #</span></th>
<th style="width: 75px;"><span style="font-size:12px;">Brand</span></th>
<th style="width: 50px;"><span style="font-size:12px;">Exp. Date</span></th>
<th style="width: 90px;"><span style="font-size:12px;">Lot #</span></th>
<th style="width: 100px;"><span style="font-size:12px;">Location</span></th>
<th style="width: 65px;"><span style="font-size:12px;">Arrival<br />Date</span></th>
<th style="width: 69px;"><span style="font-size:12px;">Unit<br />Cost</span></th>
<th style="width: 110px;"><span style="font-size:12px;">Extended<br />Cost</span></th>
<th style="width: 70px;"><span style="font-size:12px;">Qty<br />Available</span></th>
<th style="width: 64px;"><span style="font-size:12px;">Units<br />Available</span></th>
</tr>
</thead>
</table>
</macro>
</macrolist>
<style type="text/css">* {
<#if .locale == "zh_CN">
font-family: NotoSans, NotoSansCJKsc, sans-serif;
<#elseif .locale == "zh_TW">
font-family: NotoSans, NotoSansCJKtc, sans-serif;
<#elseif .locale == "ja_JP">
font-family: NotoSans, NotoSansCJKjp, sans-serif;
<#elseif .locale == "ko_KR">
font-family: NotoSans, NotoSansCJKkr, sans-serif;
<#elseif .locale == "th_TH">
font-family: NotoSans, NotoSansThai, sans-serif;
<#else>
font-family: NotoSans, sans-serif;
</#if>
}
table {
font-size: 9pt;
}
th {
font-weight: bold;
font-size: 8pt;
vertical-align: middle;
padding: 5px 6px 3px;
background-color: #e3e3e3;
color: #333333;
}
td {
padding: 4px 6px;
}
td p { align:left }
</style>
</head>
<body header="nlheader" header-height="15%" padding="0.2in 0.2in 0.2in 0.2in" size="Letter-LANDSCAPE">
<#if results?has_content><#assign subtotalEC = 0 subtotalLB = 0 subtotalCS = 0>
<table class="itemtable" style="width:100%;"><!-- start items --><#list results as result><#list result.itemid as items>
<tr>
<td style="width: 43px;"><span style="font-size:10px;">**</span></td>
<td colspan="2" rowspan="1" style="width: 70px;"><span style="font-size:10px;">${result.itemid}</span></td>
<td colspan="2" rowspan="1" style="width: 94px; white-space: nowrap;"><span style="font-size:10px;">${result.displayname}</span></td>
<td style="width: 133px;"> </td>
<td style="width: 72px;"> </td>
<td style="width: 47px;"> </td>
<td style="width: 120px;"> </td>
<td style="width: 79px;"> </td>
<td style="width: 68px;"> </td>
</tr>
<#elseif><tr>
<td style="width: 43px;"><span style="font-size:10px;">${result.custitempacksize}</span></td>
<td style="width: 70px;"><span style="font-size:10px;">${result.custcol_lottextitemlinelevel}</span></td>
<td style="width: 48px;"><span style="font-size:10px;">${result.custitem_brand}</span></td>
<td style="width: 94px;">${result.expirationdate}</td>
<td style="width: 97px;"><span style="font-size:10px;">${result.serialnumbers}</span></td>
<td style="width: 133px;"><span style="font-size:10px;">${result.location}</span></td>
<td style="width: 72px;"><span style="font-size:10px;">${result.custbodyestimatedarrivaldate}</span></td>
<td style="width: 47px;"><span style="font-size:10px;">${result.rate}</span></td>
<td style="width: 120px;"><span style="font-size:10px;">${result.formulacurrency}</span></td>
<td style="width: 79px;"><span style="font-size:10px;">${result.quantityavailable}</span></td>
<td style="width: 68px;"><span style="font-size:10px;">${result.formulanumeric}</span></td>
</tr>
</#elseif></#list>
<#else><tr>
<td style="width: 43px;">**</td>
<td colspan="3" rowspan="1" style="width: 70px;">Subtotal for : ${result.itemid}</td>
<td style="width: 97px;"> </td>
<td style="width: 133px;"> </td>
<td style="width: 72px;"> </td>
<td style="width: 47px;"> </td>
<td style="width: 120px;">
<hr />{subtotalEC}</td>
<td style="width: 79px;">
<hr />{subtotalLB}</td>
<td style="width: 68px;">
<hr />{subtotalCS}</td>
</tr>
</#else></#list><!-- end items --></table>
</#if>
</body>
</pdf>
I cannot get it to create the list I want using freemarker tags.
The code I've supplied saves with no errors
but then generates an unknown error when trying to print
or display it as PDF from the UI.
I would like the following to happen.
Have the report Group and list all items.
Under each Item List the Line level detailed information contained in the search from that item.
Subtotal 3 fields from the Grouped Info under each item and display it under the last Line of Grouped Information.
Then repeat for all items contained in the search
It might be finicky about your if-else structure.
You are closing the tags for the else-ifs and else's, where it might not like that.
Here's an example from the freemarker website:
<#if x == 1>
x is 1
<#elseif x == 2>
x is 2
<#elseif x == 3>
x is 3
<#elseif x == 4>
x is 4
<#else>
x is not 1 nor 2 nor 3 nor 4
< /#if>
Worth a try!

Gmail override font color

My code :
<tr>
<td align="center" style="font-size:9pt; font-weight : bold;font-family:Arial; color:black;">
SELLE ZETA CONFORT GEL
</td>
</tr>
When i try on different mail client, the text is black, but on gmail (explorer,chrome and firefox) this text is blue.
How can i fix this?
If you want to look an exemple:
http://issl.fr/test/test_validator.html
Take all the code html and copy it there :
https://litmus.com/email-testing
You will be able to have a preview on every client. Look the gmail one.
Because your text is sitting in an <a> tag (your <a> is wrapping the table with your text in it). That's why your text is turning to blue. Apply a color to your <a> and that should solve it... John is right to use a proper hex code for the color.
As well, Gmail likes to change color:#000000 on links to default blue even if you state that it should be color:#000000. Use color:#000001. That will solve it.
With gmail you need to be redundant on your colors.
Not only would you have to declare a color with in the but you should also wrap it in a span with the color as well.
This is one of your items below with the correct code:
<Track Link>
<a style="text-decoration : none; color:#000000;" href="http://www.decathlon.be/selle-zeta-confort-gel-id_8052361.html">
<table height="100%" width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody>
<tr><td>
<table height="100%" width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody>
<tr height="3"></tr><tr style="height : 32px !important; min-height : 32px !important; max-height : 32px !important; ">
<td width="6"></td>
<td align="left">
<div style="height :32px !important; min-height : 32px !important; max-height : 32px !important; "></div>
</td>
<td width="58"></td>
<td align="right">
<div style="height :32px !important; min-height : 32px !important; max-height : 32px !important; "><img border="0" style="display:block;" width="64" height="32" alt=" " src="http://decathlonbe.net/images/Marques/geonaute.png"></div>
</td>
<td width="6"></td>
</tr><tr height="1"></tr>
</tbody></table>
</td></tr>
<tr><td>
<table height="100%" width="100%" cellspacing="0" cellpadding="0" border="0"><tbody>
<tr>
<td align="center">
<table height="100%" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="5"></td>
<td><img width="188" border="0" alt="" src="http://www.decathlon.be/media/805/8052361/classic_400PX_asset_71685950.jpg" style="display : block;"></td>
<td width="5"></td>
</table>
</td>
</tr>
<tr>
<td align="center" style="font-size:9pt; font-weight : bold;font-family:Arial; color:black;"><span style="color:#000000;">SELLE ZETA CONFORT GEL</span></td>
</tr>
<tr>
<td align="center" style="font-size:9pt; font-family:Arial; color:#6f6f6f;"></td>
</tr>
</tbody></table>
</td></tr><tr><td>
<div class="price" style="font-family : Arial; font-size : 22pt; color : black; text-align : center;"><div class="nopromo" style="font-weight:bold;font-family : Arial; font-size : 19pt; color : black; text-align : center;">29<sup style="font-size:12pt;">€95</sup></div></div>
</td></tr><tr><td>
<table height="100%" width="100%" cellspacing="0" cellpadding="0" border="0"><tbody>
<tr>
<td width="15"></td>
<td valign="middle" align="center">
<Track Link><a style="text-decoration : none; font-family : Arial; font-weight : bold; font-size : 11pt; color : white;" href="http://www.decathlon.be/selle-zeta-confort-gel-id_8052361.html"><table align="center" cellspacing="0" cellpadding="0" border="0" style="background : #efefef;" >
<tr height="32" style="background-color : #FF7100;">
<td width="5" ><span style="color: #FF7100;">i<span></td>
<td style = "max-width: 144px;"> <div style="color : white;text-align:center; font-size : 10pt;font-family:Arial;font-weight: bold; ">sefsefse </div></td>
<td style="padding-left : 5px;">
<span style="color : white; font-weight : bold; font-size : 12pt;"> > </span>
</td>
<td width="5"><span style="color: #FF7100;">i</span></td>
</tr>
</table>
</a></Track Link>
</td>
<td width="15"></td>
</tr>
<tr height="8"></tr>
</tbody></table>
</td></tr>
</tbody></table>
</a>
In email you must use the 6-digit hex codes for maximum compatibility across email clients. Use CSS for text ie: color:#000000;, and html's bgcolor="#FFFFFF" for backgrounds
Darryl Vos's Answer is correct.
I style links with color:#00001 to achieve a black link in emails all the time.
I work in an agency and no one has ever complained it does not look black.

Resources