I have created a dynamic table and I am binding data set values to this dynamic table. I want this dynamic table to export to Excel . Here is the code
string table = string.Empty;
table += "<table cellpadding='0' cellspacing='0' width='100%'
style='border-left:solid 1px #bdbdbd;background-color:#ffffff;height:30px;'>";
table += "<tr><td colspan='2' class='cont' style='width: 50%; font-weight: bold;
padding-left: 10px; border-right:solid 1px #bdbdbd; border-bottom:solid 1px
#bdbdbd;background-color:#ffffff;height:30px; '>Mentor Name : " +
dss.Tables[0].Rows[j]["FirstName"].ToString() + "</td></tr></table>";
dv1.InnerHtml = table;
Here dv1
is the id of the div which i am concatenating table to div