You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Kai Mütz <km...@web.de> on 2006/01/02 18:13:13 UTC

Inheritance of margin/padding attributes within tables

Hi all!

I don't understand the behaviour of margin attributes within tables. I have
tested the following snippet with 3 different FO processors (FOP 0.9.1beta,
FOP 0.20.5, XEP):

<xsl:template match="test">
        <fo:block xsl:use-attribute-sets="centerhead1" hyphenate="false">
            <xsl:text>Headline</xsl:text>
        </fo:block>
        <fo:block margin-left="20mm">
            <fo:block border="solid blue 1pt"><xsl:text>Block
1</xsl:text></fo:block>
            <fo:table table-layout="fixed" width="150mm">
                <fo:table-column column-number="1" column-width="100%"/>
                <fo:table-body>
                    <fo:table-row>
                        <fo:table-cell column-number="1" border="solid
yellow 1pt">
                            <fo:block border="solid red 1pt">
                                <xsl:text>Cell 1</xsl:text>
                            </fo:block>
                        </fo:table-cell>
                    </fo:table-row>
                    <fo:table-row>
                        <fo:table-cell column-number="1" border="solid
yellow 1pt">
                            <fo:block border="solid red 1pt">
                                <xsl:text>Cell 2</xsl:text>
                            </fo:block>
                        </fo:table-cell>
                    </fo:table-row>
                </fo:table-body>
            </fo:table>
            <fo:block border="solid blue 1pt"><xsl:text>Block
2</xsl:text></fo:block>
        </fo:block>
    </xsl:template>


The second block should have a left margin of 20mm. Only XEP provides the
expected output (see attachement). FOP seems to inherit the margin
attribute. Why? Why does FOP 0.20.5 ignore the margin attribute for the
table, but use it within the table-cells? Can anyone help?

Regards, Kai

PS: Wrapping the table tag with an extra block makes no difference.

RE: AW: Inheritance of margin/padding attributes within tables

Posted by Kai Mütz <km...@web.de>.
<fo:table-body start-indent="0pt" end-indent="0pt"> works. Thanks.

<fo:table start-indent="0pt" end-indent="0pt" table-layout="fixed"
width="150mm"> doesn't work. It produces output like fop 0.20.5 in the
attached pdf.

> -----Original Message-----
> From: fop-users-return-18792-kmuetz=web.de@xmlgraphics.apache.org
> [mailto:fop-users-return-18792-kmuetz=web.de@xmlgraphics.apache.org]On
> Behalf Of Jeremias Maerki
> Sent: Tuesday, January 03, 2006 12:25 PM
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: AW: Inheritance of margin/padding attributes within tables
>
>
>
> On 03.01.2006 12:10:58 Manuel Mall wrote:
> > On Tue, 3 Jan 2006 06:01 pm, Kai Mütz wrote:
> > > No. Thanks for the hint.
> > >
> > After reading the wiki again, looking at your fo and the pdf you
> > attached I would say fop 0.9 behaves correctly with respect to the
> > XSL-FO spec but possibly against user expectations.
> >
> > Try change your fo and rewrite the table fo like:
> > ...
> >         <fo:table start-indent="0pt" end-indent="0pt"
> > table-layout="fixed" width="150mm">
> > ...
>
> The start-indent and end-indent properties should rather be set on
> table-body or else the table won't carry over the indent defined by the
> margin-left on the parent block element.
>
> > That should give for fop 0.9 the same result as XEP.
> >
> > Manuel
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: fop-users-return-18786-kmuetz=web.de@xmlgraphics.apache.org
> > > [mailto:fop-users-return-18786-kmuetz=web.de@xmlgraphics.apache.org]I
> > >m Auftrag von Manuel Mall
> > > Gesendet: Dienstag, 3. Januar 2006 02:24
> > > An: fop-users@xmlgraphics.apache.org
> > > Betreff: Re: Inheritance of margin/padding attributes within tables
> > >
> > >
> > > Kai,
> > >
> > > have you seen
> > > http://wiki.apache.org/xmlgraphics-fop/IndentInheritance ?
> > >
> > > This discusses in some detail the issues surrounding indents/margins
> > > and their (unintuitive?) inheritance behaviour.
> > >
> > > Manuel
> > >
> > > > Hi all!
> > > >
> > > > I don't understand the behaviour of margin attributes within
> > > > tables. I have
> > > > tested the following snippet with 3 different FO processors (FOP
> > > > 0.9.1beta,
> > > > FOP 0.20.5, XEP):
> > > >
> > > > <xsl:template match="test">
> > > >         <fo:block xsl:use-attribute-sets="centerhead1"
> > > > hyphenate="false"> <xsl:text>Headline</xsl:text>
> > > >         </fo:block>
> > > >         <fo:block margin-left="20mm">
> > > >             <fo:block border="solid blue 1pt"><xsl:text>Block
> > > > 1</xsl:text></fo:block>
> > > >             <fo:table table-layout="fixed" width="150mm">
> > > >                 <fo:table-column column-number="1"
> > > > column-width="100%"/> <fo:table-body>
> > > >                     <fo:table-row>
> > > >                         <fo:table-cell column-number="1"
> > > > border="solid yellow 1pt">
> > > >                             <fo:block border="solid red 1pt">
> > > >                                 <xsl:text>Cell 1</xsl:text>
> > > >                             </fo:block>
> > > >                         </fo:table-cell>
> > > >                     </fo:table-row>
> > > >                     <fo:table-row>
> > > >                         <fo:table-cell column-number="1"
> > > > border="solid yellow 1pt">
> > > >                             <fo:block border="solid red 1pt">
> > > >                                 <xsl:text>Cell 2</xsl:text>
> > > >                             </fo:block>
> > > >                         </fo:table-cell>
> > > >                     </fo:table-row>
> > > >                 </fo:table-body>
> > > >             </fo:table>
> > > >             <fo:block border="solid blue 1pt"><xsl:text>Block
> > > > 2</xsl:text></fo:block>
> > > >         </fo:block>
> > > >     </xsl:template>
> > > >
> > > >
> > > > The second block should have a left margin of 20mm. Only XEP
> > > > provides the expected output (see attachement). FOP seems to
> > > > inherit the margin attribute. Why? Why does FOP 0.20.5 ignore the
> > > > margin attribute for the table, but use it within the table-cells?
> > > > Can anyone help?
> > > >
> > > > Regards, Kai
> > > >
> > > > PS: Wrapping the table tag with an extra block makes no difference.
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: AW: Inheritance of margin/padding attributes within tables

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 03.01.2006 12:10:58 Manuel Mall wrote:
> On Tue, 3 Jan 2006 06:01 pm, Kai Mütz wrote:
> > No. Thanks for the hint.
> >
> After reading the wiki again, looking at your fo and the pdf you 
> attached I would say fop 0.9 behaves correctly with respect to the 
> XSL-FO spec but possibly against user expectations.
> 
> Try change your fo and rewrite the table fo like:
> ...
>         <fo:table start-indent="0pt" end-indent="0pt" 
> table-layout="fixed" width="150mm">
> ...

The start-indent and end-indent properties should rather be set on
table-body or else the table won't carry over the indent defined by the
margin-left on the parent block element.

> That should give for fop 0.9 the same result as XEP.
> 
> Manuel
> 
> > -----Ursprüngliche Nachricht-----
> > Von: fop-users-return-18786-kmuetz=web.de@xmlgraphics.apache.org
> > [mailto:fop-users-return-18786-kmuetz=web.de@xmlgraphics.apache.org]I
> >m Auftrag von Manuel Mall
> > Gesendet: Dienstag, 3. Januar 2006 02:24
> > An: fop-users@xmlgraphics.apache.org
> > Betreff: Re: Inheritance of margin/padding attributes within tables
> >
> >
> > Kai,
> >
> > have you seen
> > http://wiki.apache.org/xmlgraphics-fop/IndentInheritance ?
> >
> > This discusses in some detail the issues surrounding indents/margins
> > and their (unintuitive?) inheritance behaviour.
> >
> > Manuel
> >
> > > Hi all!
> > >
> > > I don't understand the behaviour of margin attributes within
> > > tables. I have
> > > tested the following snippet with 3 different FO processors (FOP
> > > 0.9.1beta,
> > > FOP 0.20.5, XEP):
> > >
> > > <xsl:template match="test">
> > >         <fo:block xsl:use-attribute-sets="centerhead1"
> > > hyphenate="false"> <xsl:text>Headline</xsl:text>
> > >         </fo:block>
> > >         <fo:block margin-left="20mm">
> > >             <fo:block border="solid blue 1pt"><xsl:text>Block
> > > 1</xsl:text></fo:block>
> > >             <fo:table table-layout="fixed" width="150mm">
> > >                 <fo:table-column column-number="1"
> > > column-width="100%"/> <fo:table-body>
> > >                     <fo:table-row>
> > >                         <fo:table-cell column-number="1"
> > > border="solid yellow 1pt">
> > >                             <fo:block border="solid red 1pt">
> > >                                 <xsl:text>Cell 1</xsl:text>
> > >                             </fo:block>
> > >                         </fo:table-cell>
> > >                     </fo:table-row>
> > >                     <fo:table-row>
> > >                         <fo:table-cell column-number="1"
> > > border="solid yellow 1pt">
> > >                             <fo:block border="solid red 1pt">
> > >                                 <xsl:text>Cell 2</xsl:text>
> > >                             </fo:block>
> > >                         </fo:table-cell>
> > >                     </fo:table-row>
> > >                 </fo:table-body>
> > >             </fo:table>
> > >             <fo:block border="solid blue 1pt"><xsl:text>Block
> > > 2</xsl:text></fo:block>
> > >         </fo:block>
> > >     </xsl:template>
> > >
> > >
> > > The second block should have a left margin of 20mm. Only XEP
> > > provides the expected output (see attachement). FOP seems to
> > > inherit the margin attribute. Why? Why does FOP 0.20.5 ignore the
> > > margin attribute for the table, but use it within the table-cells?
> > > Can anyone help?
> > >
> > > Regards, Kai
> > >
> > > PS: Wrapping the table tag with an extra block makes no difference.


Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: AW: Inheritance of margin/padding attributes within tables

Posted by Manuel Mall <ma...@apache.org>.
On Tue, 3 Jan 2006 06:01 pm, Kai Mütz wrote:
> No. Thanks for the hint.
>
After reading the wiki again, looking at your fo and the pdf you 
attached I would say fop 0.9 behaves correctly with respect to the 
XSL-FO spec but possibly against user expectations.

Try change your fo and rewrite the table fo like:
...
        <fo:table start-indent="0pt" end-indent="0pt" 
table-layout="fixed" width="150mm">
...

That should give for fop 0.9 the same result as XEP.

Manuel

> -----Ursprüngliche Nachricht-----
> Von: fop-users-return-18786-kmuetz=web.de@xmlgraphics.apache.org
> [mailto:fop-users-return-18786-kmuetz=web.de@xmlgraphics.apache.org]I
>m Auftrag von Manuel Mall
> Gesendet: Dienstag, 3. Januar 2006 02:24
> An: fop-users@xmlgraphics.apache.org
> Betreff: Re: Inheritance of margin/padding attributes within tables
>
>
> Kai,
>
> have you seen
> http://wiki.apache.org/xmlgraphics-fop/IndentInheritance ?
>
> This discusses in some detail the issues surrounding indents/margins
> and their (unintuitive?) inheritance behaviour.
>
> Manuel
>
> > Hi all!
> >
> > I don't understand the behaviour of margin attributes within
> > tables. I have
> > tested the following snippet with 3 different FO processors (FOP
> > 0.9.1beta,
> > FOP 0.20.5, XEP):
> >
> > <xsl:template match="test">
> >         <fo:block xsl:use-attribute-sets="centerhead1"
> > hyphenate="false"> <xsl:text>Headline</xsl:text>
> >         </fo:block>
> >         <fo:block margin-left="20mm">
> >             <fo:block border="solid blue 1pt"><xsl:text>Block
> > 1</xsl:text></fo:block>
> >             <fo:table table-layout="fixed" width="150mm">
> >                 <fo:table-column column-number="1"
> > column-width="100%"/> <fo:table-body>
> >                     <fo:table-row>
> >                         <fo:table-cell column-number="1"
> > border="solid yellow 1pt">
> >                             <fo:block border="solid red 1pt">
> >                                 <xsl:text>Cell 1</xsl:text>
> >                             </fo:block>
> >                         </fo:table-cell>
> >                     </fo:table-row>
> >                     <fo:table-row>
> >                         <fo:table-cell column-number="1"
> > border="solid yellow 1pt">
> >                             <fo:block border="solid red 1pt">
> >                                 <xsl:text>Cell 2</xsl:text>
> >                             </fo:block>
> >                         </fo:table-cell>
> >                     </fo:table-row>
> >                 </fo:table-body>
> >             </fo:table>
> >             <fo:block border="solid blue 1pt"><xsl:text>Block
> > 2</xsl:text></fo:block>
> >         </fo:block>
> >     </xsl:template>
> >
> >
> > The second block should have a left margin of 20mm. Only XEP
> > provides the expected output (see attachement). FOP seems to
> > inherit the margin attribute. Why? Why does FOP 0.20.5 ignore the
> > margin attribute for the table, but use it within the table-cells?
> > Can anyone help?
> >
> > Regards, Kai
> >
> > PS: Wrapping the table tag with an extra block makes no difference.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail:
> fop-users-help@xmlgraphics.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail:
> fop-users-help@xmlgraphics.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


AW: Inheritance of margin/padding attributes within tables

Posted by Kai Mütz <km...@web.de>.
No. Thanks for the hint.

-----Ursprüngliche Nachricht-----
Von: fop-users-return-18786-kmuetz=web.de@xmlgraphics.apache.org
[mailto:fop-users-return-18786-kmuetz=web.de@xmlgraphics.apache.org]Im
Auftrag von Manuel Mall
Gesendet: Dienstag, 3. Januar 2006 02:24
An: fop-users@xmlgraphics.apache.org
Betreff: Re: Inheritance of margin/padding attributes within tables


Kai,

have you seen http://wiki.apache.org/xmlgraphics-fop/IndentInheritance ?

This discusses in some detail the issues surrounding indents/margins and
their (unintuitive?) inheritance behaviour.

Manuel

> Hi all!
>
> I don't understand the behaviour of margin attributes within tables. I
> have
> tested the following snippet with 3 different FO processors (FOP
> 0.9.1beta,
> FOP 0.20.5, XEP):
>
> <xsl:template match="test">
>         <fo:block xsl:use-attribute-sets="centerhead1" hyphenate="false">
>             <xsl:text>Headline</xsl:text>
>         </fo:block>
>         <fo:block margin-left="20mm">
>             <fo:block border="solid blue 1pt"><xsl:text>Block
> 1</xsl:text></fo:block>
>             <fo:table table-layout="fixed" width="150mm">
>                 <fo:table-column column-number="1" column-width="100%"/>
>                 <fo:table-body>
>                     <fo:table-row>
>                         <fo:table-cell column-number="1" border="solid
> yellow 1pt">
>                             <fo:block border="solid red 1pt">
>                                 <xsl:text>Cell 1</xsl:text>
>                             </fo:block>
>                         </fo:table-cell>
>                     </fo:table-row>
>                     <fo:table-row>
>                         <fo:table-cell column-number="1" border="solid
> yellow 1pt">
>                             <fo:block border="solid red 1pt">
>                                 <xsl:text>Cell 2</xsl:text>
>                             </fo:block>
>                         </fo:table-cell>
>                     </fo:table-row>
>                 </fo:table-body>
>             </fo:table>
>             <fo:block border="solid blue 1pt"><xsl:text>Block
> 2</xsl:text></fo:block>
>         </fo:block>
>     </xsl:template>
>
>
> The second block should have a left margin of 20mm. Only XEP provides the
> expected output (see attachement). FOP seems to inherit the margin
> attribute. Why? Why does FOP 0.20.5 ignore the margin attribute for the
> table, but use it within the table-cells? Can anyone help?
>
> Regards, Kai
>
> PS: Wrapping the table tag with an extra block makes no difference.



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Inheritance of margin/padding attributes within tables

Posted by Manuel Mall <ma...@apache.org>.
Kai,

have you seen http://wiki.apache.org/xmlgraphics-fop/IndentInheritance ?

This discusses in some detail the issues surrounding indents/margins and
their (unintuitive?) inheritance behaviour.

Manuel

> Hi all!
>
> I don't understand the behaviour of margin attributes within tables. I
> have
> tested the following snippet with 3 different FO processors (FOP
> 0.9.1beta,
> FOP 0.20.5, XEP):
>
> <xsl:template match="test">
>         <fo:block xsl:use-attribute-sets="centerhead1" hyphenate="false">
>             <xsl:text>Headline</xsl:text>
>         </fo:block>
>         <fo:block margin-left="20mm">
>             <fo:block border="solid blue 1pt"><xsl:text>Block
> 1</xsl:text></fo:block>
>             <fo:table table-layout="fixed" width="150mm">
>                 <fo:table-column column-number="1" column-width="100%"/>
>                 <fo:table-body>
>                     <fo:table-row>
>                         <fo:table-cell column-number="1" border="solid
> yellow 1pt">
>                             <fo:block border="solid red 1pt">
>                                 <xsl:text>Cell 1</xsl:text>
>                             </fo:block>
>                         </fo:table-cell>
>                     </fo:table-row>
>                     <fo:table-row>
>                         <fo:table-cell column-number="1" border="solid
> yellow 1pt">
>                             <fo:block border="solid red 1pt">
>                                 <xsl:text>Cell 2</xsl:text>
>                             </fo:block>
>                         </fo:table-cell>
>                     </fo:table-row>
>                 </fo:table-body>
>             </fo:table>
>             <fo:block border="solid blue 1pt"><xsl:text>Block
> 2</xsl:text></fo:block>
>         </fo:block>
>     </xsl:template>
>
>
> The second block should have a left margin of 20mm. Only XEP provides the
> expected output (see attachement). FOP seems to inherit the margin
> attribute. Why? Why does FOP 0.20.5 ignore the margin attribute for the
> table, but use it within the table-cells? Can anyone help?
>
> Regards, Kai
>
> PS: Wrapping the table tag with an extra block makes no difference.



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org