0

So I have a report that generates multiple tables from a database, and grouping them by 'owner' creating a new table for each 'owner'. It does this dynamically using Angular/PHP/Js.

In the print preview I want each table to have it's own page(tables shouldn't really go beyond the length of a page) so I added the page-break-after value to each table.

My issue now is that the tables are cut off. I have the option for landscape, but unfortunately they are long tables, and still get cut off.

I have searched both here, google and w3 for a method that re-sizes the tables to fit the print preview but so far have had no luck.

Suggestions?

epp5
  • 1
  • 1
  • 5
  • Did adding page-break-after change anything with respect to tables cutting off? Wouldn't they have cut off anyway? – andi Feb 03 '16 at 21:04
  • I was just noting that, cause each table on a new page is part of the constraint. – epp5 Feb 03 '16 at 21:06
  • you might need to install something that generates a PDF of this report, if you really want this to work consistently. – andi Feb 03 '16 at 21:11
  • I think you are right. This is probably beyond the scope, (or would really be a messy tweak with css media). – epp5 Feb 03 '16 at 21:13

1 Answers1

1

You can use a media query for this. Target @print and do some trial and error to get it to look correctly when viewing in print preview. I'm assuming you haven't already done this.

https://css-tricks.com/css-media-queries/

simplyzeke
  • 62
  • 10
  • 1
    You could equally use the Chrome inspector to debug : http://stackoverflow.com/questions/2452713/suggestions-for-debugging-print-stylesheets as it will be much easier than with the print preview. – pwetosaurus Feb 03 '16 at 21:03
  • This is very close to what I needed. But because of the size of the tables, long or wide (due to contents) I should be looking to generate PDFs instead. – epp5 Feb 03 '16 at 21:14