xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Paul <ppaul_apa...@yahoo.ca>
Subject Re: [GSoC] Auto-table layout questions
Date Tue, 18 Jul 2006 04:22:53 GMT
Hello everyone,

I've been doing a little test using the following xsl-fo. Everything 
works fine except when I suppress all the column-width="..." in the 
first table then FOP doesn't give any warnings and the second table 
simply disappears. I'm not sure why this is happening.

Patrick

<?xml version="1.0" encoding="utf-8"?>

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">


  <!-- defines the layout master -->
  <fo:layout-master-set>
    <fo:simple-page-master master-name="first"
                           page-height="29.7cm"
                           page-width="21cm"
                           margin-top="1cm"
                           margin-bottom="2cm"
                           margin-left="2.5cm"
                           margin-right="2.5cm">
      <fo:region-body margin-top="3cm"/>
      <fo:region-before extent="3cm"/>
      <fo:region-after extent="1.5cm"/>
    </fo:simple-page-master>
  </fo:layout-master-set>

  <!-- starts actual layout -->
  <fo:page-sequence master-reference="first">

  <fo:flow flow-name="xsl-region-body">

      <!-- this defines a title level 1-->
      <fo:block font-size="18pt"
            font-family="sans-serif"
            line-height="24pt"
            space-after.optimum="15pt"
            background-color="blue"
            color="white"
            text-align="center"
            padding-top="3pt">
        Auto table layout test
      </fo:block>

      <!-- this defines a title level 2-->
      <fo:block font-size="16pt"
            font-family="sans-serif"
            space-after.optimum="15pt"
            text-align="center">
        A simple table -- fixed layout
      </fo:block>

    <!-- normal text -->
    <fo:block text-align="start">This simple table uses table-layout="fixed" which works
fine with Apache FOP 0.92beta.
    </fo:block>

    <!-- table start -->
    <fo:table table-layout="fixed" width="100%" border-collapse="separate">
      <fo:table-column column-width="30mm"/>
      <fo:table-column column-width="30mm"/>
      <fo:table-column column-width="100mm"/>
      <fo:table-body>
        <fo:table-row>
          <fo:table-cell ><fo:block>one</fo:block></fo:table-cell>
          <fo:table-cell ><fo:block>two</fo:block></fo:table-cell>
          <fo:table-cell ><fo:block>three: a little more texte is nice.</fo:block></fo:table-cell>
        </fo:table-row>
        <fo:table-row>
          <fo:table-cell ><fo:block>un</fo:block></fo:table-cell>
          <fo:table-cell ><fo:block>deux</fo:block></fo:table-cell>
          <fo:table-cell ><fo:block>trois</fo:block></fo:table-cell>
        </fo:table-row>
        <fo:table-row>
          <fo:table-cell ><fo:block>uno</fo:block></fo:table-cell>
          <fo:table-cell ><fo:block>dos</fo:block></fo:table-cell>
          <fo:table-cell ><fo:block>tres</fo:block></fo:table-cell>
        </fo:table-row>
        <fo:table-row>
          <fo:table-cell ><fo:block>eins</fo:block></fo:table-cell>
          <fo:table-cell ><fo:block>zwei</fo:block></fo:table-cell>
          <fo:table-cell ><fo:block>drei</fo:block></fo:table-cell>
        </fo:table-row>
      </fo:table-body>
    </fo:table>
    <!-- table end -->

    <!-- normal text -->
    <fo:block text-align="start">This is normal text.
    </fo:block>

<!-- **************************** NEW PAGE ************************************* -->

      <!-- this defines a title level 2-->
      <fo:block font-size="16pt"
            font-family="sans-serif"
            space-after.optimum="15pt"
            text-align="center"
            break-before="page">
        A simple table -- auto-table layout
      </fo:block>


    <!-- normal text -->
    <fo:block text-align="start">This the same simple table but using table-layout="auto"
which IS NOT supported by Apache FOP 0.92beta.
    </fo:block>
    
    
        <!-- table start -->
    <fo:table table-layout="auto" width="100%" border-collapse="separate">
      <fo:table-column />
      <fo:table-column />
      <fo:table-column />
      <fo:table-body>
        <fo:table-row>
          <fo:table-cell ><fo:block>one</fo:block></fo:table-cell>
          <fo:table-cell ><fo:block>two</fo:block></fo:table-cell>
          <fo:table-cell ><fo:block>three: a little more texte is nice.</fo:block></fo:table-cell>
        </fo:table-row>
        <fo:table-row>
          <fo:table-cell ><fo:block>un</fo:block></fo:table-cell>
          <fo:table-cell ><fo:block>deux</fo:block></fo:table-cell>
          <fo:table-cell ><fo:block>trois</fo:block></fo:table-cell>
        </fo:table-row>
        <fo:table-row>
          <fo:table-cell ><fo:block>uno</fo:block></fo:table-cell>
          <fo:table-cell ><fo:block>dos</fo:block></fo:table-cell>
          <fo:table-cell ><fo:block>tres</fo:block></fo:table-cell>
        </fo:table-row>
        <fo:table-row>
          <fo:table-cell ><fo:block>eins</fo:block></fo:table-cell>
          <fo:table-cell ><fo:block>zwei</fo:block></fo:table-cell>
          <fo:table-cell ><fo:block>drei</fo:block></fo:table-cell>
        </fo:table-row>
      </fo:table-body>
    </fo:table>
    <!-- table end -->

    <!-- normal text -->
    <fo:block text-align="start">The desired optimal result here is to have the third
column made larger so that the text can fit without a line-break.
    </fo:block>
    
  </fo:flow>
  </fo:page-sequence>
</fo:root>



Jeremias Maerki wrote:

>Uh, no. I just wanted to point out that "auto" is not a valid value for
>column-width. What you probably meant was the case when the user doesn't
>specify the column-width property in which case the value is not "auto"
>but "proportional-column-width(1)" (see FOPropertyMapping). If that's
>correct and usable remains to be seen.
>
>On 13.07.2006 18:20:46 Patrick Paul wrote:
>  
>
>>Thank you for the advice.
>>
>>I will sum this up on the wiki page.
>>
>>So if I understand correctly we have to support certain values even if 
>>they are illegal ?
>>
>>Patrick
>>
>>Jeremias Maerki wrote:
>>
>>    
>>
>>>Right, but strictly speaking the value "auto" is illegal for
>>>column-width. FOP currently defaults to "proportional-column-width(1)"
>>>if no value is specified.
>>>
>>>Another thing we should be careful about is the distinction between the
>>>value set for table-layout and the effective algorithm to be used. If
>>>you specify table-layout="fixed" but without an ipd, the rules for
>>>automatic table layout are activated.
>>>
>>>On 12.07.2006 22:55:44 Andreas L Delmelle wrote:
>>> 
>>>
>>>      
>>>
>>>>On Jul 12, 2006, at 22:11, Patrick Paul wrote:
>>>>
>>>>Hi Patrick,
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>>>>My first question, really simple but confusing to me, is about what is
>>>>>supposed to happen when table-layout="fixed" and one of the columns  
>>>>>has
>>>>>column-width="auto" ? Am I supposed to find out the optimal width  
>>>>>juste for
>>>>>that column ?
>>>>>     
>>>>>
>>>>>          
>>>>>
>>>>Yes, but with one big difference compared to table-layout="auto".
>>>>IIRC, CSS mentions this case explicitly: when table-layout="fixed"  
>>>>and column-width="auto" then the column-widths are ultimately the  
>>>>widths necessary for the cells in the first row. No need to look at  
>>>>the whole table, in any case...
>>>>
>>>>Cheers,
>>>>
>>>>Andreas
>>>>
>>>>
>>>>Jeremias Maerki
>>>>
>>>>        
>>>>
>
>
>
>Jeremias Maerki
>
>
>  
>


Mime
View raw message