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 Torsten Krämer <to...@wwbau.de> on 2002/02/28 08:47:36 UTC

How to expand blocks in table in table ?

I need to show a set ( a lot of ) of key-value pairs layed out in grid.
I took a table, in each cell I put a block with border and background 
set into which goes a new table with 2 rows each one cell.
First cell holds the key wich is in smaller font, and the value .

If the conent is to big for one line a linebreak is inserted an the cell
gets bigger. Fine. Only the other cells of the top-level-table will not 
expand even with space-after.optimum and  space-after set to 0. 



Question:

How can I get the cells (and nesting blocks) of one row to be 
the same height ?


Thanx, torsten k.

mailto:torsten.kraemer@wwbau.de

Code::
##############
<fo:block hyphenate="true">
  <fo:table padding="2pt" table-layout="fixed">
    <fo:table-column column-width="60mm"/>
    <fo:table-column column-width="60mm"/>
    <fo:table-column column-width="60mm"/>
    <fo:table-body>
      <fo:table-row>
        <fo:table-cell>
          <fo:block background-color="#eeeeee" border="solid"
            border-color="#aaaaaa" border-width="0.5pt"
            padding="1mm" space-after="2mm" space-end="2mm"
            space-start="2mm" start-indent="3mm">
            <fo:table padding="2pt" table-layout="fixed">
              <fo:table-column column-width="60mm"/>
              <fo:table-body>
                <fo:table-row>
                  <fo:table-cell>
                    <fo:block font-size="50%">Name</fo:block>
                  </fo:table-cell>
                </fo:table-row>
                <fo:table-row>
                  <fo:table-cell>
                    <fo:block font-size="100%">Alberts
asldkfjalöskdfjaölskdfjöalksdfjöalksdjfölakdsfjalökdsfj</fo:block>
                  </fo:table-cell>
                </fo:table-row>
              </fo:table-body>
            </fo:table>
          </fo:block>
        </fo:table-cell>

        <fo:table-cell 
          space-after.optimum="0.25mm" space-before="2mm"
space-before.optimum="2mm">
          <fo:block background-color="#eeeeee" border="solid"
            border-color="#aaaaaa" border-width="0.5pt"
            padding-start="2mm" space-after="0.25mm"
            space-after.optimum="0.25mm" space-end="2mm"
            space-start="2mm" start-indent="3mm">
            <fo:table padding="2pt" space-after="0.25mm"
              space-after.optimum="0.25mm" table-layout="fixed">
              <fo:table-column column-width="60mm"
                space-after="0.25mm" space-after.optimum="0.25mm"/>
              <fo:table-body space-after="0.25mm"
space-after.optimum="0.25mm">
                <fo:table-row>
                  <fo:table-cell>
                    <fo:block font-size="50%">Vorname</fo:block>
                  </fo:table-cell>
                </fo:table-row>
                <fo:table-row space-after="0.25mm"
space-after.optimum="0.25mm">
                  <fo:table-cell 
                    space-after="0.25mm" space-after.optimum="0.25mm">
                    <fo:block font-size="100%"
                      space-after="0.25mm"
space-after.optimum="0.25mm">Volker</fo:block>
                  </fo:table-cell>
                </fo:table-row>
              </fo:table-body>
            </fo:table>
          </fo:block>
        </fo:table-cell>
...


##############

Re: How to expand blocks in table in table ?

Posted by Chuck Paussa <Ch...@systems.dhl.com>.
Torsten,

You'll have to calculate how many lines are going to result from your 
comment text (Use length(.) on every comment and find the max number of 
lines in the xsl)

Then do a white-space-collapse="false" and insert that many &#xA; 
entries after the comments that do not meet the line wrap requirement. 
I've attached an example.

Chuck Paussa

Torsten Krämer wrote:

>I need to show a set ( a lot of ) of key-value pairs layed out in grid.
>I took a table, in each cell I put a block with border and background 
>set into which goes a new table with 2 rows each one cell.
>First cell holds the key wich is in smaller font, and the value .
>
>If the conent is to big for one line a linebreak is inserted an the cell
>gets bigger. Fine. Only the other cells of the top-level-table will not 
>expand even with space-after.optimum and  space-after set to 0. 
>
>
>
>Question:
>
>How can I get the cells (and nesting blocks) of one row to be 
>the same height ?
>
>
>Thanx, torsten k.
>
>mailto:torsten.kraemer@wwbau.de
>
>Code::
>##############
><fo:block hyphenate="true">
>  <fo:table padding="2pt" table-layout="fixed">
>    <fo:table-column column-width="60mm"/>
>    <fo:table-column column-width="60mm"/>
>    <fo:table-column column-width="60mm"/>
>    <fo:table-body>
>      <fo:table-row>
>        <fo:table-cell>
>          <fo:block background-color="#eeeeee" border="solid"
>            border-color="#aaaaaa" border-width="0.5pt"
>            padding="1mm" space-after="2mm" space-end="2mm"
>            space-start="2mm" start-indent="3mm">
>            <fo:table padding="2pt" table-layout="fixed">
>              <fo:table-column column-width="60mm"/>
>              <fo:table-body>
>                <fo:table-row>
>                  <fo:table-cell>
>                    <fo:block font-size="50%">Name</fo:block>
>                  </fo:table-cell>
>                </fo:table-row>
>                <fo:table-row>
>                  <fo:table-cell>
>                    <fo:block font-size="100%">Alberts
>asldkfjalöskdfjaölskdfjöalksdfjöalksdjfölakdsfjalökdsfj</fo:block>
>                  </fo:table-cell>
>                </fo:table-row>
>              </fo:table-body>
>            </fo:table>
>          </fo:block>
>        </fo:table-cell>
>
>        <fo:table-cell 
>          space-after.optimum="0.25mm" space-before="2mm"
>space-before.optimum="2mm">
>          <fo:block background-color="#eeeeee" border="solid"
>            border-color="#aaaaaa" border-width="0.5pt"
>            padding-start="2mm" space-after="0.25mm"
>            space-after.optimum="0.25mm" space-end="2mm"
>            space-start="2mm" start-indent="3mm">
>            <fo:table padding="2pt" space-after="0.25mm"
>              space-after.optimum="0.25mm" table-layout="fixed">
>              <fo:table-column column-width="60mm"
>                space-after="0.25mm" space-after.optimum="0.25mm"/>
>              <fo:table-body space-after="0.25mm"
>space-after.optimum="0.25mm">
>                <fo:table-row>
>                  <fo:table-cell>
>                    <fo:block font-size="50%">Vorname</fo:block>
>                  </fo:table-cell>
>                </fo:table-row>
>                <fo:table-row space-after="0.25mm"
>space-after.optimum="0.25mm">
>                  <fo:table-cell 
>                    space-after="0.25mm" space-after.optimum="0.25mm">
>                    <fo:block font-size="100%"
>                      space-after="0.25mm"
>space-after.optimum="0.25mm">Volker</fo:block>
>                  </fo:table-cell>
>                </fo:table-row>
>              </fo:table-body>
>            </fo:table>
>          </fo:block>
>        </fo:table-cell>
>...
>
>
>##############
>