My code includes multiple dynamic tables within a div element:
<div>
<table>
<tr></tr>
<tr></tr>
...
</table>
<table>
<tr></tr>
<tr></tr>
</table>
...more tables
</div>
However, when I attempt to print the div using javascript or jQuery, some tables get cut off in the middle.
I have tried using CSS properties such as page-break-after / page-break-before, but that results in each table being placed on a separate page.
Every user's table height varies, making it impossible to determine the exact height beforehand. Is there a solution to prevent splitting and only break pages when necessary?