Print view - missing styles

Print view - missing styles

lisarushlisarush Posts: 89Questions: 17Answers: 0

Link to test case:

<!DOCTYPE html>
<html>
  <head>
    <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<link href="https://cdn.datatables.net/v/dt/dt-2.1.8/b-3.1.2/b-colvis-3.1.2/b-html5-3.1.2/b-print-3.1.2/datatables.min.css" rel="stylesheet">
<script src="https://cdn.datatables.net/v/dt/dt-2.1.8/b-3.1.2/b-colvis-3.1.2/b-html5-3.1.2/b-print-3.1.2/datatables.min.js"></script>
    <meta charset=utf-8 />
    <title>DataTables - JS Bin</title>
    <style>
       .fw-bold {
           font-weight: bold;
       }
    </style>
  </head>
  <body>
    <div class="container">
<table id="example" class="display nowrap" width="100%">
  <thead>
  <tr>
     <th rowspan="2">Name</th>
     <th rowspan="2" class="noColvis">Position</th>
     <th colspan="3" class="noColvis">Values</th>
  </tr>
  <tr>
     <th>Val1</th>
     <th class="noColvis">Val2</th>
     <th>Val3</th>
  </tr>
  </thead>
 
  <tbody>
    <tr>
      <td>Tiger Nixon</td>
      <td>System Architect</td>
      <td class="dt-right fw-bold">0.5</td>
      <td>Edinburgh</td>
      <td class="dt-right fw-bold">61</td>
    </tr>
    <tr>
      <td>Garrett Winters</td>
      <td>Director</td>
      <td>0.5</td>
      <td>Edinburgh</td>
      <td>63</td>
    </tr>
    <tr>
      <td>Ashton Cox</td>
      <td>Technical Author</td>
      <td>0.5</td>
      <td>San Francisco</td>
      <td>66</td>
    </tr>
    <tr>
      <td>Cedric Kelly</td>
      <td>Javascript Developer</td>
      <td>0.5</td>
      <td>Edinburgh</td>
      <td>22</td>
    </tr>
  </tbody>
</table>
    </div>
  </body>
</html>
new DataTable('#example', {
    layout: {
        topStart: {
            buttons: [
              {
                extend:'print',
                autoPrint:false
              }
            ]
        }
    }
});

Description of problem:
Styles added to individual cells are not copied to the Print view. See classes added to 1st row above.
This is not an important issue for me, but the styles did transfer over to the Print view before I upgraded (DataTables 1.13.6 --> 2.1.8, Buttons 2.4.2 --> 3.1.2).

Sign In or Register to comment.