In my HTML page, there's a form embedded in a large table that allows users to manipulate rows by deleting, moving, and adding them dynamically.
For printing purposes, I want to ensure that no more than 25 rows appear on each page to maintain legibility and prevent layout issues caused by shrinking font sizes. To achieve this, I'm exploring the idea of inserting a page break after every set of 25 rows.
I've considered using the CSS property page-break-after
along with dynamically inserted divs (such as
<div class="page-break"></div>
), but I'm unsure of the best approach.
To determine the current number of rows in the table using jQuery, I can use the following snippet:
$(this).closest('table').find('tbody > tr').length
Additionally, rather than creating separate pages, I simply wish to repeat the table's header at the beginning of each printed page, with a maximum of 25 rows per page.
If anyone has a related example or resource to share, or if you believe this goal is unattainable, I would greatly appreciate your assistance.
Thank you in advance, Mike