3

Hello guy I have two table Cells and a <fo:leader/> in both Cells. How can i avoid to get a space between the two Cells. It's not possible to span the two cells.

enter image description here

I use Antennahouse and XSLT 2.0 .

Here is my Code for the table

 <fo:table width="100%"  >
           <fo:table-column column-width="50%"/>
           <fo:table-column column-width="50%"/>
            <fo:table-body  >
              <fo:table-row>
                 <fo:table-cell  >
                   <fo:block border-right-width="0.0mm" >
                      <xsl:if test="page">
                        <xsl:attribute name="text-align-last">justify</xsl:attribute>
                      </xsl:if>
                     <xsl:value-of select="concat(@ref1,' ')"/>  
                      <xsl:if test="page">                       
                          <fo:leader leader-pattern="dots"/>
                      </xsl:if>          
                   </fo:block>
                 </fo:table-cell>
                 <fo:table-cell >
                   <fo:block  text-align="justify" text-align-last="right" axf:text-align-first="justify">  
                     <xsl:if test="page">
                        <fo:leader leader-pattern="dots"  />
                     </xsl:if>   
                     <fo:inline><xsl:apply-templates select="page" mode="normal"><xsl:with-param name="chapter" select="@chapterNumber"></xsl:with-param></xsl:apply-templates></fo:inline></fo:block>
                 </fo:table-cell>
               </fo:table-row>
4
  • 1
    You could try making sure that there is a 0pt padding and border for the table (or just the relevant cells). Including your FO for the table could help you getting a more precise answer.
    – lfurini
    Jul 21, 2016 at 12:45
  • Where is the padding/border to set in the cell or block ?
    – Elrond
    Jul 21, 2016 at 13:13
  • So i add it for the block and the cell but nothing is changing :(
    – Elrond
    Jul 21, 2016 at 13:19
  • You code XSL does us no good as your XSL you post has if conditions in it that we cannot evaluate if we have no XML Jul 22, 2016 at 1:53

2 Answers 2

3

Without all the other stuff you have, with pure XSL FO and no extensions this works for me:

                <fo:table width="100%"  >
                    <fo:table-column column-width="50%"/>
                    <fo:table-column column-width="50%"/>
                    <fo:table-body  >
                        <fo:table-row>
                            <fo:table-cell>
                                <fo:block text-align-last="justify">     
                                    <fo:inline>Stuff</fo:inline>
                                        <fo:leader leader-pattern="dots"/>         
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell>
                                <fo:block text-align-last="justify"> 
                                        <fo:leader leader-pattern="dots"  />
                                    <fo:inline>1</fo:inline></fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                    </fo:table-body>
                </fo:table>

No spaces.

enter image description here

In response to the question, is it possible I got lucky? Tested again, various content and table column widths. Content that I am showing likely is kerned and of various lengths and I varied the size of the table cells. In all cases there is no gap.

enter image description here

I tested a few others things and realize the difference is the formatter. Apache FOP and Antennahouse yield the issue you have shown, I was using RenderX XEP (whom I work for). It does not exhibit this behavior. IMHO, the correct answer is no spaces if your formatter has the algorithms for allowing inter-character and word space squeezing to fit within an allowable tolerance. Justified is "justified".

3
  • Could it be that you were particularly lucky with the table width / pattern width comination?
    – lfurini
    Jul 24, 2016 at 15:34
  • 1
    I updated the answer with further tests., It is the formatter. I was using RenderX XEP and that does not exhibit this issue. Both FOP and Antennahouse lead to spaces as shown in the original post. Jul 24, 2016 at 18:07
  • The engine should format as Kevin suggests, with no gap.
    – kstubs
    Jul 24, 2016 at 19:15
1

I think there are two reasons for the strange "gap" between the two series of dots on each table row:

  1. the column is not an exact multiple of the leader pattern (dot + space); for example, supposing a dot and a space are 3 mm wide and the empty area to be filled by the fo:leader has a width of 17 mm, the formatter can only insert 5 dots, leaving an extra gap of 2 mm
  2. the dots on different rows are not aligned; each series of dots in the left column starts rigth from the end of the preceding text, so the gap depends also on the text length

Solution:

  • use leader-alignment="reference-area" (which XSLFormatter supports)
  • set a leader-pattern-width, and set the table width to a multiple of that
1
  • I disagree with the premise that the column width is a multiple of leader-pattern. This is impossible in practice with fonts, kerning of those characters and text length before/after the leaders. Impossible to predict. Justified text means justified text. Jul 24, 2016 at 19:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.