Recommend this page to a friend! |
All requests ![]() |
> | I need a PHP class for printing a tab... | > | Request new recommendation | > | ![]() |
> | ![]() |
by Kenneth Brown - 5 years ago (2020-02-24)
+1 | I have a table with a variable number of entries. I want to print the table using table headers and a controlled number of lines per page. |
1. by adriano ghezzi - 5 years ago (2020-02-29) Reply
Please let me understand what do you mean for 'page' 1. html doesn't have "page breaks" but you can print paginated rows with a paginator 2. if you means printed page on paper it is possible print rows on a file and insert a page break after after the reqistd numbers of rows the page braks will be interpreted by the printer nextx rows on a new page even if there is more space on the current page.
2. by Kenneth Brown - 5 years ago (2020-02-29) in reply to comment 1 by adriano ghezzi Comment
I hadn't run across the term "paginator" in the past. I'll see what I can find under that topic around the web. [My <table> has a border; I need to show the bordered table and the header row on each page that is sent to the printer, preferably without counting rows since the user may zoom somewhat uncontrolled.] Thanks for the pointer!
+2 |
As adriano already wrote, there are no page breaks, headers and footers for printing in HTML. The easiest way to solve your problem could be to create a PDF file. This can be solved with the classic FPDF package, which does not require any further extensions. As far as I understand your concerns correctly, the package supports all the functions you expect. In the meantime, the project is being continued on a separate page and kept up to date. There you will also find extensive documentation, tutorials and a user forum. |
1. by Kenneth Brown - 5 years ago (2020-02-29) Reply
I've used FPDF for a few months now, and it does create documents remarkably easily - if one has a background in typography. My <table> has a border; I need to show the bordered table and the header row on each page that is sent to the printer, preferably without counting rows. I'll wade into the <table> features of FPDF to see whether I can make that work. Thanks for the recommendation!
2. by Kenneth Brown - 5 years ago (2020-03-02) in reply to comment 1 by Kenneth Brown Reply
Page printing via FPDF did solve my printing issue, although I had to write my own routine to monitor the current printing position, height of the next row, and page height to decide when to create a new page before continuing the printing. Having a background in typography never hurts!
Recommend package | |
|