vba - create html table and have table header span more than one column -
i sending e-mail excel using outlook. body of e-mail making use of html.
i had table working fine. have been asked add header above current header of table. header called "premium / (discount)". code below fine. header span across 2 columns , centre.
i using line below not working, why?
"<th colspan='2'>premium /(discount)</th> msg = "<table style='font-size: 12pt;'><tr><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th>" & _ "<th colspan='2'>premium /(discount)</th><th> </th><th> </th><th> </th><th> </th></tr>" & _ "<tr><th align='left'>fund</th><th> </th>" & _ "<th align='left'>market spread %</th><th> </th>" & _ "<th align='left'>tolerance</th><th> </th>" & _ "<th align='left'>bid %</th><th> </th>" & _ "<th align='left'>ask %</th><th> </th>" & _ "<th align='left'>tolerance</th><th> </th>" & _ "<th align='left'>extra notes</th><th> </th></tr>"
according code, table has total of 14 columns, colspan should of 14
instead of 2
.
also, you're using of these columns space : <th> </th>
. note can better adding cell-padding value (in pixels) <table>
, table : http://cssdeck.com/labs/qyh7ytdi.
here code should trick:
msg = "<table style='font-size: 12pt;' cellpadding='5'>" & _ "<tr><th colspan='3'></th><th colspan='2'>premium /(discount)</th></tr>" & _ "<tr><th align='left'>fund</th>" & _ "<th align='left'>market spread %</th>" & _ "<th align='left'>tolerance</th>" & _ "<th align='left'>bid %</th>" & _ "<th align='left'>ask %</th>" & _ "<th align='left'>tolerance</th>" & _ "<th align='left'>extra notes</th></tr>"
Comments
Post a Comment