Knuth Element Evaluation for page breaking

Table with headers and footers

The XSL-FO snippet

<fo:table border="solid 2pt red">
  <fo:table-header>
    <fo:table-row border="solid 4pt blue">
      <fo:table-cell>
        <fo:block>header</fo:block>
      </fo:table-cell>
    </fo:table-row>
  </fo:table-header>
  <fo:table-footer>
    <fo:table-row border="solid 4pt green">
      <fo:table-cell>
        <fo:block>footer</fo:block>
      </fo:table-cell>
    </fo:table-row>
  </fo:table-footer>
  <fo:table-body>
    <fo:table-row border="solid 1pt orange">
      <fo:table-cell>
        <fo:block>cell1</fo:block>
      </fo:table-cell>
      <fo:table-cell>
        <fo:block>cell2</fo:block>
      </fo:table-cell>
    </fo:table-row>
    <fo:table-row border="solid 1pt orange">
      <fo:table-cell>
        <fo:block>cell3a</fo:block>
        <fo:block>cell3b</fo:block>
      </fo:table-cell>
      <fo:table-cell>
        <fo:block>cell4a</fo:block>
        <fo:block>cell4b</fo:block>
      </fo:table-cell>
    </fo:table-row>
  </fo:table-body>
</fo:table>

the three possibilities

http://people.apache.org/~jeremias/fop/KnuthElementsForTables.gif

the result

After a page break cause by a special penalty, the elements for the table-header must be added as first elements on the new page. The elements for the next page must be recalculated anyway (because of potentially different available IPD). Unused elements after the breaking element must be discarded.

(Note: The above is under the assumption that a non-look-ahead page breaking algorithm is implemented.)

[1] First break possibility

[2] This is no BP since the glue is not following a box.

[3] Second break possibility

PageLayout/KnuthElementEvaluation (last edited 2009-09-20 23:52:48 by localhost)