sunny sunny - 1 month ago 5
HTML Question

Table row Background Color not showing when printing

I am facing a problem background color in a tablerow.

<tr style="background-color:#999999">
<td width="204"> <strong>Opinion</strong></td>
<td width="62"> <strong>Action</strong></td>
<td colspan="4"><strong>Ratings</strong></td>
<td width="54"><strong>Outlook</strong></td>
<td width="93"><strong>Rating Type</strong></td>
</tr>


This code working fine

Here is Output

enter image description here

Problem

When I want to take print of this page.
background-color
of the row is not shown.

enter image description here

Can anyone please help me?

Answer

add this to tr style

 <style>
  .row{
   background-color:#999999;
   -webkit-print-color-adjust: exact; 
   }
 </style>

<tr class="row">
    <td width="204"> <strong>Opinion</strong></td>
    <td width="62"> <strong>Action</strong></td>
    <td colspan="4"><strong>Ratings</strong></td>
    <td width="54"><strong>Outlook</strong></td>
    <td width="93"><strong>Rating Type</strong></td>
</tr>
Comments