CVS: jfor/samples/cocoon/tests/tables 002-merged-nested-tables.xml,NONE,1.1 003-number-columns-spanned.fo.xml,NONE,1.1
Bertrand Delacretaz <[email protected]> Tue, 30 Jul 2002 08:33:04 -0700
| Newsgroups | gmane.text.xml.jfor.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/jfor/jfor/samples/cocoon/tests/tables
In directory usw-pr-cvs1:/tmp/cvs-serv27051/samples/cocoon/tests/tables
Added Files:
002-merged-nested-tables.xml 003-number-columns-spanned.fo.xml
Log Message:
New examples contributed by Boris Poudérous
--- NEW FILE: 002-merged-nested-tables.xml ---
<?xml version="1.0" encoding="iso-8859-1"?>
<fo:root xmlns:html="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master margin-right="1.5cm" margin-left="1.5cm" margin-bottom="0.3cm" margin-top="0.1cm" page-width="21cm" page-height="29.7cm" master-name="first">
<fo:region-body margin-top="2.0cm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-name="first">
<fo:flow flow-name="xsl-region-body">
<fo:block>Start of test document</fo:block>
<fo:block font-weight="bold">jfor nested tables and vertical merging example</fo:block>
<fo:block>Contributed by Boris Poudérous</fo:block>
<fo:block>Also illustrates the use of attributes that makes the RTF result look "good".</fo:block>
<fo:block space-before="10pt" space-after="5pt">
The following (2*3) table contains 2 nested tables in the third column.
</fo:block>
<fo:block>
Cells A and B should have the same height, which is the total of cells C and D.
</fo:block>
<fo:block>
Cells F and G should have the same height, which is the total of cell H and the empty cell above H.
</fo:block>
<fo:block space-after="20pt" >
We can see that the nested cells are placed in an extra row and that cells of preceding columns are merged vertically.
</fo:block>
<fo:table text-align="center" padding="0pt">
<fo:table-column column-width="32mm"/>
<fo:table-column column-width="32mm"/>
<fo:table-column column-width="32mm"/>
<fo:table-header>
<fo:table-row>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin" background-color="#FF0000">
<fo:block color="#FFFFFF" text-align="left" font-family="Helvetica" font-size="10pt">Cell A</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin" background-color="#FF0000">
<fo:block color="#FFFFFF" text-align="left" font-family="Helvetica" font-size="10pt">Cell B</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin" background-color="#FF0000">
<fo:block color="#FFFFFF" text-align="center" font-family="Helvetica" font-size="10pt">Cell C
<fo:table text-align="center" padding="0pt">
<fo:table-column column-width="16mm"/>
<fo:table-column column-width="16mm"/>
<fo:table-header>
<fo:table-row>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin" background-color="#FF0000">
<fo:block color="#FFFFFF" text-align="center" font-family="Helvetica" font-size="10pt">Nested cell D</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin" background-color="#FF0000">
<fo:block color="#FFFFFF" text-align="center" font-family="Helvetica" font-size="10pt">Nested cell E</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body/>
</fo:table>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<fo:table-row>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin" background-color="#FFFF00">
<fo:block color="#000000" text-align="left" font-family="Helvetica" font-size="8pt">Cell F</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin" background-color="#FFFF00">
<fo:block color="#000000" text-align="left" font-family="Helvetica" font-size="8pt">Cell G</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin" background-color="#FFFF00">
<fo:block color="#000000" text-align="left" font-family="Helvetica" font-size="8pt">
<fo:table text-align="center" padding="0pt">
<fo:table-column column-width="16mm"/>
<fo:table-column column-width="16mm"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin" background-color="#FFFF00">
<fo:block color="#000000" text-align="center" font-family="Helvetica" font-size="8pt">Nested cell H</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin" background-color="#FFFF00">
<fo:block color="#000000" text-align="center" font-family="Helvetica" font-size="8pt">Nested cell I</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<fo:block space-before="20pt" >
This example also shows a remaining empty cell, caused by the cell that holds nested cells H and I
containing no text.
</fo:block>
<fo:block>End of test document</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
--- NEW FILE: 003-number-columns-spanned.fo.xml ---
<?xml version="1.0" encoding="iso-8859-1"?>
<fo:root xmlns:html="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master margin-right="1.5cm" margin-left="1.5cm" margin-bottom="0.3cm" margin-top="0.1cm" page-width="21cm" page-height="29.7cm" master-name="first">
<fo:region-body margin-top="2.0cm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-name="first">
<fo:flow flow-name="xsl-region-body">
<fo:block font-weight="bold">jfor number-columns-spanned test</fo:block>
<fo:block>Contributed by Boris Poudérous</fo:block>
<fo:block>The use of the <fo:inline font-weight="bold">number-columns-spanned</fo:inline> attribute in table header creates a nice caption for tables even
though <fo:table-and-caption> and <fo:caption> are not implemented in jfor V0.7.0.
</fo:block>
<fo:block space-before="10pt" space-after="10pt">
This table should look "rectangular", the caption cell has number-columns-spanned="4"
</fo:block>
<fo:table table-layout="fixed" table-omit-header-at-break="false" text-align="center" padding="0pt">
<fo:table-column column-width="35mm"/>
<fo:table-column column-width="35mm"/>
<fo:table-column column-width="35mm"/>
<fo:table-column column-width="35mm"/>
<fo:table-header>
<fo:table-row>
<fo:table-cell number-columns-spanned="4" border-width="1pt" border-style="thin" background-color="#FF0000">
<fo:block text-align="center" font-weight="bold" font-family="Helvetica" font-size="11pt" color="#FFFFFF">Caption (span=4)</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin" background-color="blue">
<fo:block font-weight="bold" color="white" text-align="left" font-family="Helvetica" font-size="10pt">Header 1</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin" background-color="blue">
<fo:block font-weight="bold" color="white" text-align="left" font-family="Helvetica" font-size="10pt">Header 2</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin" background-color="blue">
<fo:block font-weight="bold" color="white" text-align="left" font-family="Helvetica" font-size="10pt">Header 3</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin" background-color="blue">
<fo:block font-weight="bold" color="white" text-align="left" font-family="Helvetica" font-size="10pt">Header 4</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<fo:table-row>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin">
<fo:block color="#000000" text-align="left" font-family="Helvetica" font-size="9pt">Row 1, Cell 1</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin">
<fo:block color="#000000" text-align="left" font-family="Helvetica" font-size="9pt">Row 1, Cell 2</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin">
<fo:block color="#000000" text-align="left" font-family="Helvetica" font-size="9pt">Row 1, Cell 3</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin">
<fo:block color="#000000" text-align="left" font-family="Helvetica" font-size="9pt">Row 1, Cell 4</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding="0pt" background-color="#D0D0D0" border-width="1pt" border-style="thin">
<fo:block color="#000000" text-align="left" font-family="Helvetica" font-size="9pt">Row 2, Cell 1</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" background-color="#D0D0D0" border-width="1pt" border-style="thin">
<fo:block color="#000000" text-align="left" font-family="Helvetica" font-size="9pt">Row 2, Cell 2</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" background-color="#D0D0D0" border-width="1pt" border-style="thin">
<fo:block color="#000000" text-align="left" font-family="Helvetica" font-size="9pt">Row 2, Cell 3</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" background-color="#D0D0D0" border-width="1pt" border-style="thin">
<fo:block color="#000000" text-align="left" font-family="Helvetica" font-size="9pt">Row 2, Cell 4</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin">
<fo:block color="#000000" text-align="left" font-family="Helvetica" font-size="9pt">Row 3, Cell 1</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin">
<fo:block color="#000000" text-align="left" font-family="Helvetica" font-size="9pt">Row 3, Cell 2</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin">
<fo:block color="#000000" text-align="left" font-family="Helvetica" font-size="9pt">Row 3, Cell 3</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin">
<fo:block color="#000000" text-align="left" font-family="Helvetica" font-size="9pt">Row 3, Cell 4</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<fo:block space-before="10pt" space-after="10pt">
This table should also look "rectangular" and contains several cells with number-columns-spanned
(the ones with a red background or text color)
</fo:block>
<fo:table table-layout="fixed" table-omit-header-at-break="false" text-align="center" padding="0pt">
<fo:table-column column-width="20mm"/>
<fo:table-column column-width="25mm"/>
<fo:table-column column-width="30mm"/>
<fo:table-column column-width="20mm"/>
<fo:table-column column-width="30mm"/>
<fo:table-column column-width="35mm"/>
<fo:table-header>
<fo:table-row>
<fo:table-cell number-columns-spanned="6" border-width="1pt" border-style="thin" background-color="#FF0000">
<fo:block font-weight="bold" color="#FFFFFF" text-align="center" font-family="Helvetica" font-size="11pt">Caption 2 (span=6)</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin" background-color="#FFFF00">
<fo:block font-weight="bold" text-align="left" font-family="Helvetica" font-size="10pt">Header 1</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin" background-color="#FFFF00">
<fo:block font-weight="bold" text-align="left" font-family="Helvetica" font-size="10pt">Header 2</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin" background-color="#FFFF00">
<fo:block font-weight="bold" text-align="left" font-family="Helvetica" font-size="10pt">Header 3</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin" background-color="#FFFF00">
<fo:block font-weight="bold" text-align="left" font-family="Helvetica" font-size="10pt">Header 4</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin" background-color="#FFFF00">
<fo:block font-weight="bold" text-align="left" font-family="Helvetica" font-size="10pt">Header 5</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin" background-color="#FFFF00">
<fo:block font-weight="bold" text-align="left" font-family="Helvetica" font-size="10pt">Header 6</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<fo:table-row>
<fo:table-cell number-columns-spanned="2" padding="0pt" border-width="1pt" border-style="thin">
<fo:block text-align="left" color="red" font-family="Helvetica" font-size="9pt">Row 1 Cell 1 (span=2)</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin">
<fo:block color="#000000" text-align="left" font-family="Helvetica" font-size="9pt">Row 1 Cell 3</fo:block>
</fo:table-cell>
<fo:table-cell number-columns-spanned="3" padding="0pt" border-width="1pt" border-style="thin">
<fo:block text-align="left" color="red" font-family="Helvetica" font-size="9pt">Row 1 Cell 4 (span=3)</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin">
<fo:block color="#000000" text-align="left" font-family="Helvetica" font-size="9pt">Row 2 Cell 1</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin">
<fo:block color="#000000" text-align="left" font-family="Helvetica" font-size="9pt">Row 2 Cell 2</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin">
<fo:block color="#000000" text-align="left" font-family="Helvetica" font-size="9pt">Row 2 Cell 3</fo:block>
</fo:table-cell>
<fo:table-cell number-columns-spanned="2" padding="0pt" border-width="1pt" border-style="thin">
<fo:block text-align="left" color="red" font-family="Helvetica" font-size="9pt">Row 2 Cell 4 (span=2)</fo:block>
</fo:table-cell>
<fo:table-cell padding="0pt" border-width="1pt" border-style="thin">
<fo:block color="#000000" text-align="left" font-family="Helvetica" font-size="9pt">Row 2 Cell 6</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<fo:block font-weight="bold">End of test</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31