Reputation: 27
I am trying to determine why the following XSLFO code does not make the table cell and as a consequence, the contained image, 25% of the page height:
<fo:table table-layout="auto" border-collapse="collapse" keep-together.within-page="always">
<fo:table-body>
<fo:table-row>
<fo:table-cell block-progression-dimension.maximum="25pvh">
<fo:block>
<fo:external-graphic
scaling="uniform"
src="images/tall.png"
content-height="scale-down-to-fit"
inline-progression-dimension.maximum="auto"
inline-progression-dimension.optimum="auto"
inline-progression-dimension.minimum="auto"
block-progression-dimension.minimum="auto"
block-progression-dimension.optimum="auto"
block-progression-dimension.maximum="100%" />
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
The output is:
I'd expect the table cell, and as a consequence, the embedded tall image (which is higher than the page height at its intrinsic size), to be at max 25% of the page height, due to setting <fo:table-cell block-progression-dimension.maximum="25pvh">
.
Why is the table with its single cell still 100% of the available content height?
Upvotes: 0
Views: 467
Reputation: 8068
Use:
<fo:table-row block-progression-dimension.maximum="25pvh">
<fo:table-cell block-progression-dimension.maximum="25pvh">
Was:
Either move the block-progression-dimension.maximum="25pvh"
to the fo:table-row
or use height
on the fo:table-cell
.
I am checking to see whether it is an Antenna House Formatter bug, but the current result might be because a row with auto
row height uses the actual height of the content of its table cells.
https://www.w3.org/TR/xsl11/#height refers to http://www.w3.org/TR/REC-CSS2/tables.html for the height of table rows.
https://www.w3.org/TR/CSS2/tables.html#height-layout includes:
The height of a 'table-row' element's box is calculated once the user agent has all the cells in the row available: it is the maximum of the row's computed 'height', the computed 'height' of each cell in the row, and the minimum height (MIN) required by the cells. A 'height' value of 'auto' for a 'table-row' means the row height used for layout is MIN. MIN depends on cell box heights and cell box alignment (much like the calculation of a line box height).
and:
In CSS 2.1, the height of a cell box is the minimum height required by the content. The table cell's 'height' property can influence the height of the row (see above), but it does not increase the height of the cell box.
From https://www.w3.org/TR/xsl11/#fo_table-cell:
The method for determining the block-progression-dimension of the cell in the grid is governed by the row-height trait.
The fo:table-row
definition has a similar statement, but the 'row-height' trait isn't actually defined in XSL 1.1.
You haven't restricted the height of the content of the fo:table-cell
, so the row is taking the height of the cell's content.
From https://www.w3.org/TR/xsl11/#fo_external-graphic:
The viewport's size is determined by the block-progression-dimension and inline-progression-dimension traits. For values of "auto", the content size of the graphic is used.
Upvotes: 0