Forum How do I...?

Table Page Break Question

esmith
When generating a pdf where I have a long table on the left and a small div to the right, the breaking of the table works fine along with repeating the captions. The issue that I am having is that instead of filling out the current page with as much of the table as it can along with the div(the div will fit on the current page), it does a page break before and then displays the table and the div on the next page as you can see in the picture below. If i take out the div, it seems to work fine. Is there a way that I can prevent this from happening?

report page 1.png


report page 2.png


Thanks

Eric
  1. report page 1.png140.9 kB
  2. report page 2.png197.3 kB
mikeday
Applying certain CSS properties can cause this, including the 'page-break-inside' and 'height' properties. What style rules are you applying to the div and the table? Is the table or div floated?
esmith
I am not using height properties. I am currently using prince-linebreak-magic: auto; on the body, but removing this still causes the issue. I have also tried the 'page-break-inside' with different issues.

Here is a simplified version of what I am doing which is still causing the page break to happen.

<div>
<div style="float:left">
<table>
</table>
</div>
<div style="float:left">
</div>
</div>
mikeday
Breaking floats across multiple pages is not recommended if you can avoid it. How about Making the second div float right, and not floating the first div? Or placing both divs inside a table with two columns, instead of using float?
esmith
Thank you so much.

I removed all floats and added it to a table and it is working perfect.