We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Table row break across pages

Converting HTML to PDF. Although my CSS contains the following:
table tr td{page-break-inside: avoid;}
table rows still break inside across pages. I expect it to break between rows, not inside rows. What am I doing wrong?

@vladigubler
Could you provide the file and code (snippet) so we can reproduce the situation?

You would need to have a very large table with a lot of rows so it can spill over. Make sure each cell contains multiple lines of text.
For example:

<html>
<body>
<style>
table{
border-collapse: collapse;
}
table tr td
{ 
page-break-inside:avoid;
border: 1px solid #ccc;
}
</style>
<table>
<tr><td><div>aaa</div><div>bbb</div><div>ccc</div><div>ddd</div><div>eee</div></td></tr>
<tr><td><div>aaa</div><div>bbb</div><div>ccc</div><div>ddd</div><div>eee</div></td></tr>
<tr><td><div>aaa</div><div>bbb</div><div>ccc</div><div>ddd</div><div>eee</div></td></tr>
<tr><td><div>aaa</div><div>bbb</div><div>ccc</div><div>ddd</div><div>eee</div></td></tr>
<tr><td><div>aaa</div><div>bbb</div><div>ccc</div><div>ddd</div><div>eee</div></td></tr>
<tr><td><div>aaa</div><div>bbb</div><div>ccc</div><div>ddd</div><div>eee</div></td></tr>
<tr><td><div>aaa</div><div>bbb</div><div>ccc</div><div>ddd</div><div>eee</div></td></tr>
<tr><td><div>aaa</div><div>bbb</div><div>ccc</div><div>ddd</div><div>eee</div></td></tr>
<tr><td><div>aaa</div><div>bbb</div><div>ccc</div><div>ddd</div><div>eee</div></td></tr>
<tr><td><div>aaa</div><div>bbb</div><div>ccc</div><div>ddd</div><div>eee</div></td></tr>
<tr><td><div>aaa</div><div>bbb</div><div>ccc</div><div>ddd</div><div>eee</div></td></tr>
<tr><td><div>aaa</div><div>bbb</div><div>ccc</div><div>ddd</div><div>eee</div></td></tr>
<tr><td><div>aaa</div><div>bbb</div><div>ccc</div><div>ddd</div><div>eee</div></td></tr>
<tr><td><div>aaa</div><div>bbb</div><div>ccc</div><div>ddd</div><div>eee</div></td></tr>
<tr><td><div>aaa</div><div>bbb</div><div>ccc</div><div>ddd</div><div>eee</div></td></tr>
<tr><td><div>aaa</div><div>bbb</div><div>ccc</div><div>ddd</div><div>eee</div></td></tr>
</table>
</body>
</html>

Expectation: page breaks at between rows.
Reality: page breaks inside the row, with some text of the same cell on one page, and some on the next.

I am not using any special options to convert, just:
HtmlLoadOptions options = new HtmlLoadOptions();

@vladigubler
Please excuse me for the delay in replying.
I contacted the development team and they reproduced the issue. The development team has a task.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

  Issue ID(s): PDFNET-53531

You can obtain Paid Support services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Thanks, we are good for now. When do you expect the fix to be released? Just so we know approximately.

@vladigubler
Unfortunately, I can’t give any dates. As soon as there is information on this task, I will let you know.

Fair enough, thanks!