I need a PHP class for printing a table with page breaks: Want to control page breaks when printing a large table

Recommend this page to a friend!
  All requests RSS feed  >  I need a PHP class for printing a tab...  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

I need a PHP class for printing a table with page breaks

A request is featured when there is no good recommended package on the site when it is posted. Edit

Picture of Kenneth Brown by Kenneth Brown - 8 months ago (2020-02-24)

Want to control page breaks when printing a large table

This request is clear and relevant.
This request is not clear or is not relevant.

0

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 Clarification request
  • 1. Picture of adriano ghezzi by adriano ghezzi - 7 months 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. Picture of Kenneth Brown by Kenneth Brown - 7 months 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!

Ask clarification

1 Recommendation

FPDF: Free PDF generation class without PDFlib

This recommendation solves the problem.
This recommendation does not solve the problem.

+1

Picture of Stefan Kientzler by Stefan Kientzler Reputation 280 - 7 months ago (2020-02-29) Comment

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.

  • 2 Comments
  • 1. Picture of Kenneth Brown by Kenneth Brown - 7 months 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. Picture of Kenneth Brown by Kenneth Brown - 7 months 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
: 
: 
For more information send a message to info at phpclasses dot org.