2012-02-21 76 views
1

我已经动态创建与字符串生成器,表后,不应用..CSS打印

当我运行这个页面背景颜色

被应用到“日”,但是当打印的页面它不打印背景颜色。但是,当我施加字体颜色“日”然后它打印字体颜色印刷后..

StringBuilder strhtmlcontent = new StringBuilder(); 
strhtmlcontent.Append("<table id='mytable' align='Center' style='background-color:#' BORDER-COLLAPSE:collapse cellSpacing=0 rules=all border=1 width=100% ><th width=8% style='background-color:Lime;'>FirstName</th>"); 
strhtmlcontent.Append("</table>"); 
ttpContext.Current.Response.Write(strhtmlcontent); 
HttpContext.Current.Response.Flush(); 

感谢。

+0

默认情况下,浏览器不会打印背景颜色。这是浏览器的设计,与编程无关。 – 2012-02-21 11:55:48

+0

[如何获得背景图像使用css打印?]可能的副本(http://stackoverflow.com/questions/5949897/how-to-get-a-background-image-to-print-using-css) – 2012-02-21 11:57:15

回答