Print striped table using bootstrap 3 and css3

1

I have a report in which I have a table with many rows. But when I print the colors of the striped bootstrap table they do not appear in the printout.

I can print the colors in the columns, as you can see in: jsfiddle.net/pfdiass/1kvmjwxa/2

The color blue was to exemplify what I can do so far, but it's not what I want. What I really want is to print the lines one white background color and one red color (as in the html above).

I tried to do this, but it did not work:

@media print {    
    .table.table-striped td:nth-of-type(odd) {
        background-color: red!important;
        -webkit-print-color-adjust: exact; 
    }
}

Changing <td> in the above code by <tr> the result is what I get in the code posted in jsfiddle.

    
asked by anonymous 02.12.2015 / 22:44

1 answer

1

I did it! I changed my code to:

@media print {    
  tr:nth-child(even) td{
    background-color: red !important;
    -webkit-print-color-adjust: exact; 
  }
}

As you can see here: link

    
03.12.2015 / 12:21