W3C home > Mailing lists > Public > www-xsl-fo@w3.org > September 2007

Same height rows in table

From: Winterflood, Jonathan <jonathan.winterflood@capgemini.com>
Date: Mon, 10 Sep 2007 17:26:54 +0200
Message-ID: <9FD178D09DF6AC43B2FF313CFB0D11ED299B64@CORPMAIL33.corp.capgemini.com>
To: <www-xsl-fo@w3.org>

Hi,

I'm trying to tell xsl-fo to keep all rows in a table the same height:

The table contains 2 columns, and 2(n) rows.
The second column spans all rows and contains a 'large' graphic and
makes the table expand beyond the height required by the first column
rows.
In this case, the last row in the first column grows so the bottom edge
matches that of the second column (like a table, fancy that!) and is
therefore taller than the other rows.

I would like all the rows to keep the same height, i.e. expand together
to match the height of the second column.

Current:    Wanted:
+---+---+   +---+---+
|   |   |   |   |   |
+---+   |   |   |   |
|   |   |   |   |   |
|   |   |   +---+   |
|   |   |   |   |   |
|   |   |   |   |   |
|   |   |   |   |   |
+---+---+   +---+---+

Is this possible without hard-coding the height of the lines? (I would
rather not calculate the size of the content of the second column...)

I have tried setting the table-row heights to 50% (100/n%), to no avail.

Just in case it matters, I'm using Apache FOP for the rendering.

Here is a (hopefully) minimal example:

<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
 <xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
 <fo:layout-master-set>
  <fo:simple-page-master master-name="test">
   <fo:region-body/>
  </fo:simple-page-master>
 </fo:layout-master-set>
 <fo:page-sequence master-reference="test">
  <fo:flow flow-name="xsl-region-body">
<fo:table width="100%" table-layout="fixed">
 <fo:table-column column-width="80%"/>
 <fo:table-column column-width="20%"/>
 <fo:table-body>
  <fo:table-row>
   <fo:table-cell border-style="solid">
    <fo:block>A</fo:block>
   </fo:table-cell>
   <fo:table-cell number-rows-spanned="2" border-style="solid">
    <fo:block>BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB
BBBBBBBB</fo:block>
   </fo:table-cell>
  </fo:table-row>
  <fo:table-row>
   <fo:table-cell border-style="solid">
    <fo:block>C</fo:block>
   </fo:table-cell>
  </fo:table-row>
 </fo:table-body>
</fo:table>
  </fo:flow>
 </fo:page-sequence>
</fo:root>
 </xsl:template>
</xsl:stylesheet>

Regards,

Jonathan Winterflood


This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient,  you are not authorized to read, print, retain, copy, disseminate,  distribute, or use this message or any part thereof. If you receive this  message in error, please notify the sender immediately and delete all  copies of this message.
Received on Monday, 10 September 2007 21:47:37 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:06:14 GMT