public string htmlbody()
{
StringBuilder strHTML = new StringBuilder();
strHTML.Append("<html>");
strHTML.Append("<head>");
strHTML.Append("</head>");
strHTML.Append("<body>");
strHTML.Append("<table border='1' cellspacing='0' cellpadding='0' text-align='center'border-collapse='collapse';>");
strHTML.Append("<tr>");
foreach (DataColumn mycolumn in tbl.Columns)
{
strHTML.Append("<td>");
strHTML.Append(mycolumn.ColumnName);
strHTML.Append("<td>");
}
strHTML.Append("</tr>");
for (int i = 0; i < tbl.Rows.Count; i++)
{
strHTML.Append("<tr>");
for (int j = 0; j < tbl.Columns.Count; j++)
{
strHTML.Append("<td >");
strHTML.Append(tbl.Rows[i][j]);
strHTML.Append("<td>");
}
strHTML.Append("</tr>");
}
strHTML.Append("</table>");
strHTML.Append("</body>");
strHTML.Append("</html>");
string Htmltext = strHTML.ToString();
return Htmltext;
}