c# - How to format HTML table properly in Outlook mailitem -


i'm using c# pragmatically create outlook mail item populates html table. problem is, when email sent looks hell on earth in outlook. understand formats differently in outlook versus chrome. understand html elements need contain inline styles, , cannot use css. knowing of , creating nice inline table in brackets ide , using same code in c# , sending email outlook, still looks terrible.

how can accomplish decent formatted table using html/outlook??

here of c# code.

 sb.append("<table border=\"1px solid black\";>");         sb.append("<tr>");         sb.appendformat("<th style=\"1px solid black\";>{0}</th>");         sb.appendformat("<th style=\"1px solid black\";>{0}</th>");         sb.appendformat("<th style=\"1px solid black\";>{0}</th>");         sb.appendformat("<th style=\"1px solid black\";>{0}</th>");         sb.appendformat("<th style=\"1px solid black\";>{0}</th>");         sb.appendformat("<th style=\"1px solid black\";>{0}</th>");         sb.appendformat("<th style=\"1px solid black\";>{0}</th>");         sb.appendformat("<th style=\"1px solid black\";>{0}</th>");         sb.append("</tr>");         sb.append("</table>"); 

1) if target outlook mail client only, suggest create table in 1 of microsoft tools - either in outlook or word. in outlook have view raw email email markup, word can save document html.

2) in example code seems 'border' part missing in style attributes.

sb.appendformat("<th style=\"border: 1px solid black\";>{0}</th>"); 

i guess works in browser because browsers tolerate badly formatted markup pretty good, while outlook not much.


Comments

Popular posts from this blog

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

arrays - Algorithm to find ideal starting spot in a circle -