I am trying to export an HTML table to excel but I cannot set the background color of a cell by CSS, I’ve tried:
Response.Write("<style type=\"text/css\">");
Response.Write("td { background-color: #000000; }");
Response.Write("</style>");
But this has no affect on my output. Is there some mso css attribute for cell color?
Try to use something similar to
<Interior ss:Color='#01F501' ss:Pattern='Solid'/>…For some in-depth information regarding the HTML approach to creating Excel files with sample code see http://www.c-sharpcorner.com/UploadFile/kaushikborah28/79Nick08302007171404PM/79Nick.aspx
Also checkout the official documentation at http://msdn.microsoft.com/en-us/library/Aa155477%28office.10%29.aspx