How to make the table header repeat on all pages

2

I'm trying to print using CSS and I have a table with thead and tfoot, I'm trying to do this by printing all the table header pages, however the result is the same, it shows only the first page and the others does not work . If I can put the header and footer of the table on each page I will have the behavior I want that is in printing a table on each page.

I tried it that way

thead   {display: table-header-group;   }
tfoot   {display: table-footer-group;   }
    
asked by anonymous 06.02.2014 / 01:22

1 answer

3

thead and tfoot are meant for this, but some browsers do not adapt well to this, especially Chrome that has a bug . Apparently the bug is also present in Safari and Opera.

I think you'll have to do it on hand or look for some solution in javascript.

Emergency Technical Resource I realized that if generating PDF works normally. A viable solution may be to generate a PDF when the user wants to print. Staples the CTRL + P shortcut keys with Javascript, and when the user presses, you can open a popup with the generated PDF already sending to print.

Note: It is only an alternative if it is really necessary for the header to appear repeating when printed on the chrome. This way it would be standard for all browsers, and would avoid support with the famous PDF printer

Extra:

A good guide to creating tables can be found in css-tricks

    
06.02.2014 / 03:10