1

I'm using Bootstrap as my framework.
To print parts of page i use "printThis" jquery plugin.

When i print a table, the active class wont show.
Active is filled row (cell).

How can i fix this?

HTML/php

if($day == "Mån"){
  $mark_monday = "active";
}

echo "<tr class='print_table_text ".$mark_monday."'>";

UPDATE CSS
I tried this, and only bold is in the print!?
I can see the "active" class added by bootstrap on webpage. But it´s not shown in the print.

.print_table_text {
  font-size: 10px;
}
.print_table_text.active {
  font-weight: bold;
  background-color: #000000;
}

PrintTHis

<script>
  $(document).ready(function () {
    $('#print_btn').click(function () {
        loadCSS: "css/printthis-print_all_usrs_time.css"
        $('#usr_name, #list_usr_time, #sum_worked_time, #break_page').printThis();
    });
});
</script>

UPDATE

I did remove the bootstrap class "active". And created an own class called grey. I used the style sheet to add background color grey. But the same problem accours. I can see the grey background in my browser, but not on the print.

$mark_monday = "bggrey";

.print_table_text.bggrey {
  font-weight: bold;
  background-color: #f5f5f5;
}

The bold attribute is on the print, but not the BG color.

Björn C
  • 3,860
  • 10
  • 46
  • 85
  • Please post the code you are using to initiate the printThis functionality. – Jason Aug 13 '15 at 20:26
  • The bold property works and displays on the print. But the "active" class, from Bootstrap who makes table row grey, aint shown on the print. – Björn C Aug 17 '15 at 09:55

1 Answers1

2

Add this media query to your styles that will be applied for a print

@media print {
    td.active {
        background-color: #f5f5f5;
    }
}
iurii
  • 4,142
  • 2
  • 23
  • 28
  • This would be the correct method (I am the printThis author). – Jason May 20 '15 at 19:47
  • @Jason Thank you. I'm not so good at CSS. But i tried this example with no success. Also i updated my question with half working css. Strange "bold" is shown, but not "background-color". – Björn C May 21 '15 at 05:36
  • I tried changing td.active to tr.active with no succes. – Björn C Aug 17 '15 at 10:03
  • @Mjukis - http://stackoverflow.com/questions/14987496/background-color-not-showing-in-print-preview – Jason Aug 19 '15 at 22:11