/// <summary> /// Return the content as Html string /// </summary> /// <returns>The html string</returns> public string GetHtml() { bool isRightAlign = false; const string outerHtml = "<table border=0 cellspacing=0 cellpadding=0 border=0 style=\"width: 16.55cm; \">\n\n<tr>\n<td align=right>\n"; string html = "<table hspace=\"14\" vspace=\"14\" cellpadding=\"2\" cellspacing=\"2\" border=\"0\" bgcolor=\"#000000\" "; const string htmlRight = "<table cellpadding=\"2\" cellspacing=\"2\" border=\"0\" bgcolor=\"#000000\" "; if (TableStyle.TableProperties != null) { if (TableStyle.TableProperties.Align != null) { string align = TableStyle.TableProperties.Align.ToLower(); if (align == "right") { isRightAlign = true; html = htmlRight; } else if (align == "margin") { align = "left"; } html += " align=\"" + align + "\" "; } html += TableStyle.TableProperties.GetHtmlStyle(); } html += ">\n"; if (RowHeader != null) { html += RowHeader.GetHtml(); } foreach (Row row in Rows) { html += row.GetHtml() + "\n"; } html += "</table>\n"; //Wrapp a right align table with outer table, //because following content will be right to //the table! if (isRightAlign) { html = outerHtml + html + "\n</td>\n</tr>\n</table>\n"; } return(html); }