Complex tables printing beyond A4 page margins

Please consider adding code to the tables and TablePress so that complex tables don’t print beyond the margin in PDF (for print) exported documents. This might require native tables and TablePress tables to be modified so they do not extend beyond the margins when exported to PDF for printing. This may involve adding CSS code to switch the orientation of these pages to landscape, as well as either reducing the size of the tables or continuing the complex table on the next page.

Hi,
Did you get a solution for this or do you just add custom CSS? Facing a similar issue and the CSS doesn’t seem to solve it.

Hi Rahil

You might like to test this solution someone sent me, but we haven’t had a chance to try. Please let me know if it works:

"I’ve worked with a few books that have long or wide tables in Pressbooks, and I’ve found I need to alter the standard CSS to allow the table to break over pages, otherwise it will leave large blank spaces and default to starting a table on a new page in an effort to keep rows together.

I use this code in the custom CSS for print:
table, tr, th{
page-break-inside: auto!important;
}

If the table is tagged correctly with header rows, the headers should show up on the top of every new page that the table overflows onto.

For very wide tables, I think I’ve put a < div > element around it to rotate the whole table 90 degrees, but I don’t have an example of that handy. If that’s something that would be helpful I can dig it up, though."