in the table I have one column that contains a URLs.
because I don't want the table to be too wide I want to limit the URL column,
I tried using nowarp tags in the table but with no luck.
I tried using CSS but it seems like the outlook is removing them.
my code is:
have two function that create the HTML code:
the first which creates the table headers:
Expand|Select|Wrap|Line Numbers
- private string SetEmailBody(bool _withTime)
- {
- string tmp;
- tmp = "<HTML>\n <Body> \n<br> \n <table border=\"1\" cellspacing=\"0\" cellpadding=\"1\" style=\"width:1200; border:0.5px solid black;\">";
- tmp = tmp + "<tr bgcolor=\"#999999\">\n";
- tmp = tmp + "<td align=center style=\"border:0.5px solid black;\"><div><Font Face='Arial' Size=2>ID</Font></div></td>\n";
- if (_withTime)
- {
- tmp = tmp + "<td align=center style=\"border:0.5px solid black;\"><div><Font Face='Arial' Size=2>Date</Font></div></td>\n";
- tmp = tmp + "<td align=center style=\"border:0.5px solid black;\"><div><Font Face='Arial' Size=2>Time</Font></div></td>\n";
- }
- tmp = tmp + "<td align=center style=\"border:0.5px solid black;\"><div style=\"width : 40px; word-break : break-all; overflow : hidden; text-overflow: hidden;\"><Font Face='Arial' Size=2>Link</Font></div></td>\n";
- tmp = tmp + "</tr>\n";
- return tmp;
- }
the second which add to the table new row:
Expand|Select|Wrap|Line Numbers
- private string EmailBodyAddLine(string ID, string time, string date, string URL, bool _withTime)
- {
- string tmp = "<tr>\n";
- //ID
- tmp = tmp + "<td align=center style=\"border:0.5px solid black;\"><div id=\"idcol\"><Font Face='Arial' Size=2>%id%</Font></div></td>\n".Replace("%id%", ID);
- //Include time stemp
- if (_withTime)
- {
- tmp = tmp + "<td align=center style=\"border:0.5px solid black;\"><div id=\"timecol\"><Font Face='Arial' Size=2>%date%</Font></div></td>\n".Replace("%date%", date);
- tmp = tmp + "<td align=center style=\"border:0.5px solid black;\"><div id=\"timecol\"><Font Face='Arial' Size=2>%time%</Font></div></td>\n".Replace("%time%", time);
- }
- tmp = tmp + "<td align=left style=\"border:0.5px solid black;\"><div style=\"height : 19px; width : 40px; word-break : break-all; overflow : hidden; text-overflow: hidden;\"><Font Face='Arial' Size=2>%URL%</Font></div></td>\n".Replace("%URL%", URL);
- tmp = tmp + "</tr>\n\n";
- return tmp;
- }
then I close the final string with
"</table>\n </html> "
and save it to the outlook draft
But when open in the outlook draft, seems like the CSS is partial working
for ex' the <div> size limit and the text over-flow are not implemented.
Thanks