Hi Georg,

Georg Datterl wrote:
> Hi everybody, it's me again and as usual, I have a fascinating little fo file 
> for you. 

Fascinating... Indeed...


> Todays topic: creating blank space without padding-* or space-*, whether you 
> want it or not. 
> In my fo file, I have an outer table with one cell and a bottom border. 
> Inside I have a middle table with three rows and two columns. 
> Row one, cell one contains a simple block. 
> Row one, cell two spans all three rows and contains blocks and a table. This 
> cell contains most of the data and should define the height of the outer 
> table.
> Row two, cell one contains a block with fixed height and a block with 
> break-before=page. This makes the block move to the next page and break the 
> table in row one, cell two at the height of the fixed-height block.
> Row three, cell one contains a block which should sit at the foot height of 
> the table in row one, cell two, just above the bottom line of the outer 
> table. 
> 
> Now, if it worked, I wouldn't write this. Funny thing is: Everything looks as 
> expected, only the bottom line of the outer table is way below the bottom 
> line of the inner table. And I don't see a reason. Maybe somebody else wants 
> to play around with it and tell me why there's a gap.

I’m not going to enter the details, but there seems to be a flaw in the
algorithm that deals with tables. There are many weird situations that
can occur with tables, and the algorithm tries to account for all of
them, and it basically fails at that. Basic cases are simple, but when
you introduce forced breaks, fixed row heights, row-spanning cells,
etc., you quickly reach the limits of the approach.

I attached to this message a version of your FO file that I simplified
in order to ease debugging. The following computations have been made
based on that file.

Basically, at the page break, the algorithm believes that there is more
of the second column to lay out on the second page than is actually the
case.

If there were no forced break, the whole table would fit on a single
page, and the rows would resp. have the following heights: 10pt, 86pt,
90pt.

But there is a forced break. But the second column can’t be broken
before the first cell of the inner table. So all that content (112.5pt)
must be put on the first page. Which makes the first row have a height
of 10pt, and the second row a height of 102.5pt on the first page, and
10pt on the second page. There are 73.5pt of content from the second
column to be put on the second page, so the third row will grow
accordingly to 73.5pt minus the height of the second row, so 63.5pt...
But the algorithm will still make it 90pt high. Hence the additional
white space at the bottom of the table cell.

If you remove the surrounding table the problem disappears, but I guess
you have a good reason for it being there. I have no other workaround in
mind at the moment, but I’ll try to think about that.


Vincent
<!-- edited with XMLSpy v2006 sp1 U (http://www.altova.com) by Joerg Geyer (Geneon media solutions gmbh) -->
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"; xmlns:fox="http://xmlgraphics.apache.org/fop/extensions";>
  <fo:layout-master-set>
    <fo:simple-page-master page-height="10cm" page-width="595.276pt" master-name="content1">
      <fo:region-body margin-right="29.764pt" margin-left="49.606pt" margin-bottom="46.772pt" margin-top="36.85pt" column-count="1"/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="content1">
    <fo:flow flow-name="xsl-region-body" font-size="8pt" line-height="10pt">
      <fo:block border="0.5pt solid blue"
        border-before-width.length="0.5pt" border-before-width.conditionality="retain"
        border-after-width.length="0.5pt"  border-after-width.conditionality="retain"
        padding="2pt"
        padding-before.length="2pt" padding-before.conditionality="retain"
        padding-after.length="2pt"  padding-after.conditionality="retain">
        <!--
        -->
        <fo:table table-layout="fixed" width="100%">
          <fo:table-body>
            <fo:table-row>
              <fo:table-cell border="0.5pt solid black">
                <fo:table width="100%" table-layout="fixed">
                  <fo:table-column column-width="25%"/>
                  <fo:table-column column-width="75%"/>
                  <fo:table-body>
                    <fo:table-row keep-with-next.within-page="always">
                      <fo:table-cell>
                        <fo:block>111</fo:block>
                      </fo:table-cell>
                      <fo:table-cell number-rows-spanned="3">
                        <fo:block keep-together.within-page="always">
                          <fo:block>text</fo:block>
                          <fo:block>text</fo:block>
                          <fo:block>text</fo:block>
                          <fo:block>text</fo:block>
                          <fo:block>text</fo:block>
                          <fo:block>text</fo:block>
                          <fo:block>text</fo:block>
                          <fo:block>text</fo:block>
                          <fo:block>text</fo:block>
                          <fo:block>text</fo:block>
                          <fo:block space-after="2pt" keep-with-next.within-page="always" 
                            keep-with-next.within-column="always"/>
                        </fo:block>
                        <fo:table width="30pt" table-layout="fixed">
                          <fo:table-body>
                            <fo:table-row>
                              <fo:table-cell border-style="solid" border-width="0.5pt">
                                <fo:block>160 </fo:block>
                              </fo:table-cell>
                            </fo:table-row>
                            <fo:table-row>
                              <fo:table-cell border-style="solid" border-width="0.5pt">
                                <fo:block>160 </fo:block>
                              </fo:table-cell>
                            </fo:table-row>
                            <fo:table-row>
                              <fo:table-cell border-style="solid" border-width="0.5pt">
                                <fo:block>160 </fo:block>
                              </fo:table-cell>
                            </fo:table-row>
                            <fo:table-row>
                              <fo:table-cell border-style="solid" border-width="0.5pt">
                                <fo:block>160 </fo:block>
                              </fo:table-cell>
                            </fo:table-row>
                            <fo:table-row>
                              <fo:table-cell border-style="solid" border-width="0.5pt">
                                <fo:block>160 </fo:block>
                              </fo:table-cell>
                            </fo:table-row>
                            <fo:table-row>
                              <fo:table-cell border-style="solid" border-width="0.5pt">
                                <fo:block>160 </fo:block>
                              </fo:table-cell>
                            </fo:table-row>
                            <fo:table-row>
                              <fo:table-cell border-style="solid" border-width="0.5pt">
                                <fo:block>160 </fo:block>
                              </fo:table-cell>
                            </fo:table-row>
                            <fo:table-row>
                              <fo:table-cell border-style="solid" border-width="0.5pt">
                                <fo:block>160 </fo:block>
                              </fo:table-cell>
                            </fo:table-row>
                          </fo:table-body>
                        </fo:table>
                      </fo:table-cell>
                    </fo:table-row>
                    <fo:table-row keep-with-next.within-page="always">
                      <fo:table-cell>
                        <fo:block line-height="76pt"><fo:inline> </fo:inline></fo:block>
                        <fo:block break-before="column">222</fo:block>
                      </fo:table-cell>
                    </fo:table-row>
                    <fo:table-row>
                      <fo:table-cell display-align="after">
                        <fo:block>333</fo:block>
                      </fo:table-cell>
                    </fo:table-row>
                  </fo:table-body>
                </fo:table>
              </fo:table-cell>
            </fo:table-row>
          </fo:table-body>
        </fo:table>
        <!--
        -->
      </fo:block>
    </fo:flow>
  </fo:page-sequence>
</fo:root>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to