Imprint striped table using bootstrap 3 and css3

Asked

Viewed 435 times

1

I have a report in which I have a table with many lines. But when I have the colors of the bootstrap striped table printed they don’t appear in the print.

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

The blue color 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 color white background and the other red (as in the html above).

I tried to do it this way, but it didn’t work:

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

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

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: http://jsfiddle.net/pfdiass/1kvmjwxa/5/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.