Forum How do I...?

Table row spilling to new page

mickyjtwin
I have a html page which is marked up with 4 table rows. Each row has a set height, which is defined by a div in the td. The overflow is set to hidden for the divs.
The height approx. equals the height of the page once converted to pdf.
If i add an image to any of the first 3 rows (this image being higher than the div), it is cropped by overflow, and the pdf is one page. However, if I place an image in the last row, it spills over. Each row is exactly the same.

<table cellspacing="0" cellpadding="0" border="0" style="border:none; border-collapse:collapse; height: 40;">
<tr>
   <td><div height="10"><img src="/image.jpg"/></div></td>
</tr>
<tr>
   <td><div height="10"><img src="/image.jpg"/></div></td>
</tr>
<tr>
   <td><div height="10"><img src="/image.jpg"/></div></td>
</tr>
<tr>
   <td><div height="10"><img src="/image.jpg"/></div></td>
</tr>
</table>


It is becoming frustrating. I have used a reset stylesheet to remove all padding, margins etc, and to no avail. Only on the last row.
mikeday
We have been able to replicate a similar issue here, and will investigate to see if there is a bug fix or workaround. Thanks for letting us know. :)
mickyjtwin
That's great thanks. I have posted in another topic which I believe is related.

http://www.princexml.com/bb/viewtopic.php?t=2032

I am currently resizing the images to fit the width/height container specified, however if I want to keep the desired width, the overflow should work as a "crop". I did try to create a crop funciton, however the image seemed to come through to the PDF smaller, i.e. I believe there is an issue with how the cropped image is being rewritten, i.e. the resolution settings etc are not coming through correct, making the image appear smaller in the PDF.
mikeday
How about putting the table inside a div and moving the height and overflow properties to this container div? I've tried this and it seems to produce the results that you are looking for, clipping the bottom row and not breaking pages.