Reputation: 19
i have page that print report from my site, and i set the table for show grid result.
So, my problem is, i set for th
attrbute table background color, this background is show on page before print it, But when print it, the th
background not show.
here my css code :-
@media print {
.head th {
background: #CCCCCC;
background: -webkit-gradient(linear, left top, left bottom, from(#CCCCCC), to(#CCCCCC));
background: -moz-linear-gradient(top, #CCCCCC, #CCCCCC);
border: 1px solid #000000;
font-size: 16px;
text-align: center;
font-weight:bold;
padding:10px;
}
}
.wrap{
width: auto;
background:#fff;
word-wrap: break-word;
margin:30px;
}
th {
background: #CCCCCC;
background: -webkit-gradient(linear, left top, left bottom, from(#CCCCCC), to(#CCCCCC));
background: -moz-linear-gradient(top, #CCCCCC, #CCCCCC);
border: 1px solid #000000;
font-size: 16px;
text-align: center;
font-weight:bold;
padding:10px;
}
how can i show the th
backgound when i print this page.
Upvotes: 0
Views: 760
Reputation: 492
try to have a look at -webkit-print-color-adjust:exact;
to enable your browser print colored background...
valuses:
economy Normal behavior. Background colors and images are only printed if the user explicitly allows it in their browser's print settings dialog.
exact Background colors and images of the element to which this rule is applied are always printed, user's print settings are overridden.
hope this helps
Upvotes: 2