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 Barry Hansen <bh...@imany.com> on 2002/09/04 19:56:29 UTC

smushing table text together

I have been playing with this for some time now and I cannot seem to find an
answer with my experimentation or from searching the archives.

I've got a table that has a cell that has several potential blocks in it. I
want to keep the blocks spaced out but place them close to the cell border
if there is no other text. For example, if I have a cell that has:
----------------------    (Example 1)
blockFormat1

blockFormat2
----------------------

but might be:
----------------------    (Example 2)
blockFormat2
----------------------

If I add space-end to the end of the fo:block and that block is by itself,
it makes:
----------------------    (Example 3)
blockFormat1

----------------------

and if I add it before (space-before in the fo:block) and that block is by
itself, it makes:
----------------------     (Example 4)

blockFormat2
----------------------

And without any spacing, I get (as you might predict)
----------------------     (Example 5)
blockFormat1
blockFormat2
----------------------

Any suggestions for how I can get examples 1 and 2 without causing examples
3 and 4?

Thanks,
Barry Hansen
I-many, Inc.
bhansen@imany.com

Re: smushing table text together

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Barry Hansen wrote:
> I've got a table that has a cell that has several potential blocks in it. I
> want to keep the blocks spaced out but place them close to the cell border
> if there is no other text.

If you are using XSLT to generate the FO, generate
the space-after for the first block only if there
will be a following block, for example if you are
transforming <p> into <fo:block>:
   <fo:block>
     <xsl:if test="following-sibling::p"
       <xsl:attribute name="space-after">10pt</xsl:attribute>
     </xsl:if>
     <xsl:apply-templates/>
   </fo:block>

A pure FO realisation could take advantage of space
conditionality, unfortunately, FOP currently does
not implement this feature completely.

J.Pietschmann