HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › HTML/CSS rendering issues › How Split a Table Header In Each Page
- This topic has 9 replies, 3 voices, and was last updated May 23, 2011
14:44:23 by PD4ML.
-
AuthorPosts
-
September 24, 2010 at 11:42#26460
Hi All,
I Have One Small Problem i.e we have One Table The Table Header Are Print In Each Page
How To I Write A code Please Tell Me!
Note:- I am Writing The Code In html.
I Hope U have Solve This Small Problem
October 23, 2010 at 12:43#28216PD4ML API includes enableSmartTableBreaks() (formerly enableTableBreaks()) method. The method forces PD4ML to split tables protecting table rows content and to replicate table headers (if any) from page to page. Unfortunately there is no way to trigger the mode from HTML code yet.
Table header ia a row (or multiple rows) consists of
tags only.
In v361b2 the table break logic was significantly refactored. So it is recommended to use the build or a newer one.
April 28, 2011 at 02:21#28217I have the following CSS and table html
tr.noBreakCell{
page-break-inside:avoid;
}header 1 header 2 header 3 header 4 cell 1 cell 2 cell 3 cell 4 cell 1 cell 2 cell 3 cell 4 …
cell 1 cell 2 cell 3 cell 4 I have a number of tr row with class = noBreakCell, I found that when I not use:
pd4mlObj.enableSmartTableSplit(true);the table is break while row does not break inside, this is fine.
But I try to have the table header repeat on different page, it turns out that the whole table is being moved to the next page instead of splitting into multiple page, did I use anything wrongly?
April 28, 2011 at 02:30#28218Previous post typo mistable, it should be
enableSmartTableBreaks(true);April 28, 2011 at 04:42#28219Here this is the HTML that I try to print using PD4ML:
download fromdropbox:
http://dl.dropbox.com/u/9697160/PackNote.htm
I applied page-break-inside:avoid in tr with class ‘noBreak’When I set enableSmartTableBreaks(false); or not apply the statement, it can split table without spliting table tr row, just the table header does not repeat.
When I set enableSmartTableBreaks(true); as the table cannot fit completely in the first page, it completely moved to the second page. leaving the first page with blank area.
PD4ML is great in helpping us developing our print out function but just this spliting not yet fulfill our print test. Really look forward to see whether it is because of my table html / css or JAVA set wrongly.
The ver of PD4ML we used: 3701b1 demo (we need to see PD4ML fulfill our test in order to buy the volumn licenses)
code for html generation: JAVA/JSP
how we use pd4ml: we build jsp report and use PD4ML to handle the print by mean of converting the built pdf file to bytearray and send to our printer.April 29, 2011 at 10:51#28220enableSmartTableBreaks(true) implicitly defines
TABLE, TR { page-break-inside: avoid }
You may partially override it with
TABLE { page-break-inside: auto !important }
to prevent a table moving to its next page.
May 3, 2011 at 03:32#28221Does this valid in PD4ML if I wish a particular block not to be broken:
div{page-break-inside: avoid}
May 3, 2011 at 11:06#28222For DIV it should work.
May 23, 2011 at 05:34#28223@ustarhk wrote:
I have the following CSS and table html
tr.noBreakCell{
page-break-inside:avoid;
}header 1 header 2 header 3 header 4 cell 1 cell 2 cell 3 cell 4 cell 1 cell 2 cell 3 cell 4 …
cell 1 cell 2 cell 3 cell 4 I have a number of tr row with class = noBreakCell, I found that when I not use:
pd4mlObj.enableSmartTableSplit(true);the table is break while row does not break inside, this is fine.
But I try to have the table header repeat on different page, it turns out that the whole table is being moved to the next page instead of splitting into multiple page, did I use anything wrongly?
May 23, 2011 at 14:44#28224pd4mlObj.enableSmartTableSplit(true) API call implicitly defines
TABLE, TR {page-break-inside: avoid }
In order to workaround the issue you faced with, I would recommend to partially unset the CSS style with
TABLE {page-break-inside: avoid !important}
-
AuthorPosts
The forum ‘HTML/CSS rendering issues’ is closed to new topics and replies.