0

I have my html and I want to the colors to be applied when I do print preview or print the page. But the problem is, it is not working. I also tried

@media print {
  tbody tr:nth-child(odd) {
  background: rgba(170, 184, 255, 0.4) !important;
  -webkit-print-color-adjust:  exact; 
 }
}

@media screen {
  tbody tr:nth-child(odd) {
  background: rgba(170, 184, 255, 0.4) !important;
  -webkit-print-color-adjust:  exact; 
 }
}

but it doesn't apply the colors on print preview. I read related questions like this but it wasn't helpful. What should I do to fix it.

For better understanding, I have the updated code in jsfiddle. https://jsfiddle.net/8v4gn4Lu/

Community
  • 1
  • 1
Sumit Sahay
  • 504
  • 4
  • 22

0 Answers0