Created attachment 26367 [details] Another Example When a fo:table-cell is embedded withing a fo:block with a margin set, the fo:table-cell will inherit the margin left from the fo:block. Example: <fo:block margin="30px"> <fo:table width="100%" table-layout="fixed"> <fo:table-column column-width="proportional-column-width(1)" /> <fo:table-body> <fo:table-row> <fo:table-cell> <fo:block> Table Cell No Margin Defined </fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> </fo:block> When the above is rendered, the text "Table Cell No Margin Defined" will be rendered with a margin-left of 30. This happens even if you add another fo:block outside the table with margin set to 0. Adding a margin-left="0" to the fo:table-cell will fix the renderer.
Created attachment 26368 [details] Render of Attached Example
This behaviour is correct regarding REC XSL v1.1 (§5.3.2, see [1]). In addition, there is a wiki page about this topic (see [2]). [1] http://www.w3.org/TR/xsl/#refine-margin-space-indent [2] http://wiki.apache.org/xmlgraphics-fop/IndentInheritance
I don't believe the spec explains the behavior I am seeing. 1) In the attached example, margin-left is being inherited by the table-cell from the table's grandparent(margin="30px"), even though the table's parent has it set.(margin="0px") 2) Only margin-right and margin-left are being inherited, margin-top and margin-bottom are not.
As said in REC XSL v1.1 §5.3.2, inheritance and computed values for *-indent are for start-* and end-* sides (left/right in a lr-tb context). Since fo:block doesn't provide a reference area, inheritance mechanism is played. A good practice to indent a table is: - use a fo:block-container (witch generates a reference area) to surround the table - set start-indent or end-indent properties on this fo:b-c - set *-indent properties to 0 on fo:table (or what ever content) to enforce the inherited *-indent to 0 (you can insert a fo:block for such thing between fo:b-c and fo:table. In addition, FOP provides the ability to break the REC-XSL inheritance behaviour: see the config option [break-indent-inheritance] at [1] Note: for before-* and after-* properties, the strategy is quite different: - stacking areas is not the same problem. - see the .conditionality sub-property. [1] http://xmlgraphics.apache.org/fop/1.0/configuration.html
batch transition to closed for remaining resolved bugs