Todays blog entry will be an open question to any XSL-developer.
Is there a way to use the HTML equivalent 'rowspan' in XSL-FO? I want to display a text with a bigger font in the leftmost column. The colums to the right however should consist of a couple of rows with smaller text.
In HTML this would be written something like this:
<table border="1" cellpadding="4" cellspacing="0"> <tr> <td rowspan="3" style="font-weight:bold;font-size:14pt">New Text</td> <td>Value 1</td> <td>Value 2</td> <td></td> </tr> <tr> <td>{someAttribute}</td> <td>{someOtherAttribute}</td> <td></td> </tr> <tr> <td>Value 3</td> <td>Value 4</td> <td>Value 5</td> </tr> </table> |
and look like this:

Here is the code for XSL-FO without the new leftmost column.
<xsl:template name="printAddress"> <xsl:param name="subDocument"/> <fo:table table-layout="fixed" background-color="#e0e0e0" keep-with-next.within-page="always">
<fo:table-column column-width="7.0cm"/> <fo:table-column column-width="7.0cm"/> <fo:table-column column-width="2.0cm"/>
<fo:table-body>
<!-- Begin Row 1 --> <fo:table-row keep-with-previous="always"> <fo:table-cell margin-left="0.2cm" padding-before="0.1cm" padding-after="0.1cm"> <fo:block>Value 1</fo:block> </fo:table-cell> <fo:table-cell margin-left="0.2cm" padding-before="0.1cm" padding-after="0.1cm"> <fo:block>Value 2</fo:block> </fo:table-cell> <fo:table-cell margin-left="0.2cm" padding-before="0.1cm" padding-after="0.1cm"> <fo:block/> </fo:table-cell> </fo:table-row> <!-- Begin Row 2 --> <fo:table-row keep-with-previous="always"> <fo:table-cell margin-left="0.2cm" padding-before="0.1cm" padding-after="0.1cm"> <fo:block> <xsl:value-of select="$subDocument/someAttribute"/> </fo:block> </fo:table-cell> <fo:table-cell margin-left="0.2cm" padding-before="0.1cm" padding-after="0.1cm"> <fo:block> <xsl:value-of select="$subDocument/someOtherAttribute"/> </fo:block> </fo:table-cell> <fo:table-cell margin-left="0.2cm" padding-before="0.1cm" padding-after="0.1cm"> <fo:block/> </fo:table-cell> </fo:table-row> <!-- Begin Row 3 --> <fo:table-row keep-with-previous="always"> <fo:table-cell margin-left="0.2cm" padding-before="0.1cm" padding-after="0.1cm"> <fo:block>value 3</fo:block> </fo:table-cell> <fo:table-cell margin-left="0.2cm" padding-before="0.1cm" padding-after="0.1cm"> <fo:block>Value 4</fo:block> </fo:table-cell> <fo:table-cell margin-left="0.2cm" padding-before="0.1cm" padding-after="0.1cm"> <fo:block>Value 5</fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> </xsl:template> |
The HTML-equivalent for the above code would be to only remove this row from the provided HTML code at the top:
| <td rowspan="3" style="font-weight:bold;font-size:14pt">New Text</td> |
How would the XSL-FO code look like to provide the same look as the figure at the top?