I'm using page-break-inside : avoid ; and some java script to prevent tables from breaking over two pages, it's working correctly but it's adding random spacing between tables. Is there anyway to prevent this from happening?
I'm only having this issue in chrome, anyone know how I can get rid of these spaces?

table {
border-collapse: separate;
border-spacing: 2px;
border-color: gray;
page-break-inside : avoid ;
position:relative;
}
There seem to be various possible reasons page-break-inside would work oddly in Google Chrome or Webkit browsers in general:
The easiest solution would be to add the page-break-inside: avoid; to a surrounding div element instead.
HTML:
<div class="no-page-break">
<table>
<tr>
<td>1</td>
<td>2</td>
</tr>
<tr>
<td>3</td>
<td>4</td>
</tr>
</table>
</div>
CSS:
.no-page-break {
page-break-inside: avoid;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With