Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to tell Safari to repeat a table header on printed pages?

Tags:

Is it possible to repeat table headers in Safari on every printed page?

This code works in Firefox but not in Safari:

<table>
  <thead>
    <tr>
      <td>Header1</td>
      <td>Header2</td>
    </tr>
  </thead>

  <!-- lots of rows -->
</table>

Edit:

the following doesn't fix it, therefore it can't be the same bug that IE has:

thead { display:table-header-group; }
like image 638
Georg Schölly Avatar asked Jan 19 '09 22:01

Georg Schölly


2 Answers

To answer my own question:

After googling and getting no correct answer I think that there exists simply no method to accomplish it. Maybe later versions of Safari will include it.

like image 99
Georg Schölly Avatar answered Oct 21 '22 07:10

Georg Schölly


You could consider reprinting the thead periodically as you go down the table. If the table is rather long, this might prove beneficial even when viewed on screen, as the header will most likely scroll off the screen pretty quickly. If you don't want to show it on screen, though, you could add a class to the reprinted headers, hide them on screen, and display them only in the print stylesheet.

like image 25
Scott Cranfill Avatar answered Oct 21 '22 09:10

Scott Cranfill