Hello! Necessary cross-browser solution.

There was a task to print long tables, they are wide in width on an A4 sheet in landscape orientation, you need to make sure that, under certain conditions, individual lines (the & lt; tr & gt; tag) are carried over to a new page . The variant with different tables on each new page does not fit, since The width of the columns on all pages should be the same .

The variants with page-break- * for the breakdown of tables work only in Opera browsers, and based on the comment written here , table breaks do not work in tables, and they are simply not recommended to be used.

  • Alternatively, use PDF to display such tables, in the PDF file, long tables can be split into different pages and this solution should work in any browser if the PDF file display plugin is installed. - spoilt
  • Thank you, but the PDF version is not yet suitable, the customer wants this to be done by means of html - nolka
  • <br style="page-break-after: always"> - Vfvtnjd

1 answer 1

Draw a long table on the required number of pages and enter data into specific rows of the table that are already on another page (calculate, having a certain constant — the height of the table in rows per page) and trace only those rows that have data.

  • Hello! Thank you for your option, but alas, it does not fit, because On these pages in those places where space allows, you need to insert additional separate information blocks, as well as printing headings and table of contents on each new page - nolka
  • colspan and rowspan will help you with this))) - Yoharny Babai
  • Noooo, I did it differently, I started counting the size of the rows of the tables in pixels, summarize them, if the size of the summarized rows exceeds the pre-selected value, then add what we add to the new table, and print to the page, and for the rest, reset the size counter lines. Each of the tables is assigned a page-break-before value: always - nolka