pichlerd1 / flying-saucer

Automatically exported from code.google.com/p/flying-saucer
0 stars 0 forks source link

Tables with avoid page break start don't start at top new page #55

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
*** This issue was imported from http://java.net/jira/browse/XHTMLRENDERER-302

It was reported by jpuig on 29.12.2009 12:57:20 +0100 and last updated in the 
previous bug tracker on 29.12.2009 12:57:53 +0100

Found in
Operating System: All
Platform: All

The priority for this issue at migration was Major.
The original issue had attachments to it; see comments below.

Original description: 
Hi,

I have been trying to generate a document with some tables that would normally
be broken in order to fit. With the avoid page break hint I am able to get them
in one page, but extrangely, they don't start at the top of the new page. There
is an offset before the table that I believe looks about the amount of blank
space that should have been added to the previous page

Here is an example with all the formatting I use:

<html>
<head>
<style type="text/css" media="print">
@Page{
margin-bottom: 2.0cm; 
margin-left: 2.0cm; 
margin-right: 2.0cm; 
margin-top: 2.0cm; 
size: a4 portrait; 

@top-center{
content: element(header);
}
@bottom-center{
content: element(footer);
}
}

#header{
display: block; 
margin-top: 0.0cm; 
position: running(header); 

}#footer{
display: block; 
position: running(footer); 

}
#pagenumber:before {
content: counter(page);
}

#pagecount:before {
content: counter(pages);
}

*.s00{
margin-bottom: 0px; 
margin-left: 0px; 
margin-right: 0px; 
margin-top: 0px; 
}
*.s01{
outline-bottom-style: none; 
outline-left-style: none; 
outline-right-style: none; 
outline-top-style: none; 
}
*.s02{
border-bottom-style: none; 
border-left-style: none; 
border-right-style: none; 
border-top-style: none; 
}
*.s03{
padding-bottom: 0px; 
padding-left: 0px; 
padding-right: 0px; 
padding-top: 0px; 
}
*.s04{
background: rgb(255,255,255); 
}
*.s05{
text-align: left; 
}
*.s06{
color: rgb(0,0,0); 
font-family: Times New Roman; 
font-size: 12pt; 
font-style: normal; 
font-weight: normal; 
text-decoration: none; 
}
*.s07{
margin-bottom: 0px; 
margin-top: 0px; 
}
*.s08{
border-bottom-style: none; 
border-left-style: none; 
border-right-style: none; 
border-top-color: rgb(0,0,0); 
border-top-style: solid; 
border-top-width: 2px; 
}
*.s09{
background: rgb(255,255,255); 
width: 100.0%; 
}
*.s10{
border-bottom-style: none; 
border-left-style: none; 
border-right-style: none; 
border-top-color: rgb(255,255,255); 
border-top-style: solid; 
border-top-width: 5px; 
}
*.s11{
color: rgb(0,0,0); 
font-family: Franklin Gothic Book; 
font-size: 10pt; 
font-style: normal; 
font-weight: normal; 
text-decoration: none; 
}
*.s12{
color: rgb(0,0,0); 
font-family: Franklin Gothic Book; 
font-size: 50pt; 
font-style: normal; 
font-weight: normal; 
text-decoration: none; 
}
*.s13{
display: inline-table; 
}
*.s14{
border-spacing: 2; 
page-break-inside: avoid; 
}
*.s15{
background: rgb(150,170,150); 
}
*.s16{
text-align: left; 
vertical-align: bottom; 
}
</style>
</head>
<body>
<div id="header">
</div>
<div id="footer">
</div>
<p class="s00 s01 s02 s03 s04 s05">
<span class=" s06">
TEST: TablePageBreakOffset</span>
</p>
<hr class="s07 s01 s08 s03 s09"/>
<hr class="s00 s01 s10 s03 s04"/>
<p class="s00 s01 s02 s03 s04 s05">
<span class=" s11">
Some separation...</span>
</p>
<p class="s00 s01 s02 s03 s04 s05">
<span class=" s12">
...</span>
</p>
<p class="s00 s01 s02 s03 s04 s05">
<span class=" s12">
...</span>
</p>
<p class="s00 s01 s02 s03 s04 s05">
<span class=" s12">
...</span>
</p>
<p class="s00 s01 s02 s03 s04 s05">
<span class=" s12">
...</span>
</p>
<p class="s00 s01 s02 s03 s04 s05">
<span class=" s12">
...</span>
</p>
<p class="s00 s01 s02 s03 s04 s05">
<span class=" s12">
...</span>
</p>
<p class="s00 s01 s02 s03 s04 s05">
<span class=" s12">
...</span>
</p>
<div class=" s05">
<div class=" s13">
<table class="s00 s01 s02 s03 s04 s14">
<tr class="s00 s01 s02 s03 s04">
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
</tr>
<tr class="s00 s01 s02 s03 s04">
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
</tr>
<tr class="s00 s01 s02 s03 s04">
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
</tr>
<tr class="s00 s01 s02 s03 s04">
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
</tr>
</table>
</div>
</div>
</body>
</html>

<html>
<head>
<style type="text/css" media="print">
@Page{
margin-bottom: 2.0cm; 
margin-left: 2.0cm; 
margin-right: 2.0cm; 
margin-top: 2.0cm; 
size: a4 portrait; 

@top-center{
content: element(header);
}
@bottom-center{
content: element(footer);
}
}

#header{
display: block; 
margin-top: 0.0cm; 
position: running(header); 

}#footer{
display: block; 
position: running(footer); 

}
#pagenumber:before {
content: counter(page);
}

#pagecount:before {
content: counter(pages);
}

*.s00{
margin-bottom: 0px; 
margin-left: 0px; 
margin-right: 0px; 
margin-top: 0px; 
}
*.s01{
outline-bottom-style: none; 
outline-left-style: none; 
outline-right-style: none; 
outline-top-style: none; 
}
*.s02{
border-bottom-style: none; 
border-left-style: none; 
border-right-style: none; 
border-top-style: none; 
}
*.s03{
padding-bottom: 0px; 
padding-left: 0px; 
padding-right: 0px; 
padding-top: 0px; 
}
*.s04{
background: rgb(255,255,255); 
}
*.s05{
text-align: left; 
}
*.s06{
color: rgb(0,0,0); 
font-family: Times New Roman; 
font-size: 12pt; 
font-style: normal; 
font-weight: normal; 
text-decoration: none; 
}
*.s07{
margin-bottom: 0px; 
margin-top: 0px; 
}
*.s08{
border-bottom-style: none; 
border-left-style: none; 
border-right-style: none; 
border-top-color: rgb(0,0,0); 
border-top-style: solid; 
border-top-width: 2px; 
}
*.s09{
background: rgb(255,255,255); 
width: 100.0%; 
}
*.s10{
border-bottom-style: none; 
border-left-style: none; 
border-right-style: none; 
border-top-color: rgb(255,255,255); 
border-top-style: solid; 
border-top-width: 5px; 
}
*.s11{
color: rgb(0,0,0); 
font-family: Franklin Gothic Book; 
font-size: 10pt; 
font-style: normal; 
font-weight: normal; 
text-decoration: none; 
}
*.s12{
color: rgb(0,0,0); 
font-family: Franklin Gothic Book; 
font-size: 50pt; 
font-style: normal; 
font-weight: normal; 
text-decoration: none; 
}
*.s13{
display: inline-table; 
}
*.s14{
border-spacing: 2; 
page-break-inside: avoid; 
}
*.s15{
background: rgb(150,170,150); 
}
*.s16{
text-align: left; 
vertical-align: bottom; 
}
</style>
</head>
<body>
<div id="header">
</div>
<div id="footer">
</div>
<p class="s00 s01 s02 s03 s04 s05">
<span class=" s06">
TEST: TablePageBreakOffset</span>
</p>
<hr class="s07 s01 s08 s03 s09"/>
<hr class="s00 s01 s10 s03 s04"/>
<p class="s00 s01 s02 s03 s04 s05">
<span class=" s11">
Some separation...</span>
</p>
<p class="s00 s01 s02 s03 s04 s05">
<span class=" s12">
...</span>
</p>
<p class="s00 s01 s02 s03 s04 s05">
<span class=" s12">
...</span>
</p>
<p class="s00 s01 s02 s03 s04 s05">
<span class=" s12">
...</span>
</p>
<p class="s00 s01 s02 s03 s04 s05">
<span class=" s12">
...</span>
</p>
<p class="s00 s01 s02 s03 s04 s05">
<span class=" s12">
...</span>
</p>
<p class="s00 s01 s02 s03 s04 s05">
<span class=" s12">
...</span>
</p>
<p class="s00 s01 s02 s03 s04 s05">
<span class=" s12">
...</span>
</p>
<div class=" s05">
<div class=" s13">
<table class="s00 s01 s02 s03 s04 s14">
<tr class="s00 s01 s02 s03 s04">
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
</tr>
<tr class="s00 s01 s02 s03 s04">
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
</tr>
<tr class="s00 s01 s02 s03 s04">
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
</tr>
<tr class="s00 s01 s02 s03 s04">
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
<td class="s00 s01 s02 s03 s15 s16">
<p class="s00 s01 s02 s03 s15 s05">
<span class=" s12">
x</span>
</p>
</td>
</tr>
</table>
</div>
</div>
</body>
</html>

Original issue reported on code.google.com by pdoubl...@gmail.com on 16 Feb 2011 at 9:47

GoogleCodeExporter commented 8 years ago
Attachment by jpuig on 29.12.2009 12:57:53 +0100:  doc.pdf, size 10322 bytes
Download: http://java.net/jira/secure/attachment/27412/doc.pdf

Original comment by pdoubl...@gmail.com on 16 Feb 2011 at 9:47

GoogleCodeExporter commented 8 years ago
jpuig wrote on 29.12.2009 12:57:53 +0100:
Created an attachment (id=104)
Sample output

Original comment by pdoubl...@gmail.com on 16 Feb 2011 at 9:47

GoogleCodeExporter commented 8 years ago
What is the fix for this bug? Need urgent help!!!

Original comment by sruthiay...@gmail.com on 21 Aug 2014 at 8:24