单元格背景颜色导出HTML到Excel [英] Cell Background Color exporting HTML to Excel
问题描述
我想导出HTML表到excel,但我不能设置一个单元通过CSS的背景颜色,我已经试过:
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>");
但是,这并没有对我的输出影响。是否有单元格颜色一些MSO的CSS属性?
But this has no affect on my output. Is there some mso css attribute for cell color?
推荐答案
尝试使用类似的东西来&LT;内饰SS:颜色='#01F501'SS:模式='实'/&GT;
...
Try to use something similar to <Interior ss:Color='#01F501' ss:Pattern='Solid'/>
...
对于一些深入的关于HTML的方法来创建Excel文件样本code见的http://www.c-sharpcorner.com/UploadFile/kaushikborah28/79Nick08302007171404PM/79Nick.aspx
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
此外,在 HTTP签正式文件msdn.microsoft.com/en-us/library/Aa155477%28office.10%29.aspx
这篇关于单元格背景颜色导出HTML到Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!