thebigdir > References > Analog Ocean Minded Ezekiel Element Fox Honolua Matix Mada Jet Pilot Surf Clothing And FootwareExample Repository
Example repository: index | categories | search

All > XSL FO > General > table


Title: table
Origin: Apache FOP 0.18.1 examples

PDF output | FO file
ElementsAttributes
fo:blockbackground-color | break-before | color | font-family | font-size | line-height | padding-top | space-after.optimum | start-indent | text-align |
fo:flowflow-name |
fo:layout-master-set
fo:page-sequencemaster-name |
fo:region-afterextent |
fo:region-beforeextent |
fo:region-bodymargin-top |
fo:root
fo:simple-page-mastermargin-bottom | margin-left | margin-right | margin-top | master-name | page-height | page-width |
fo:tablebackground-color | border-style | border-width |
fo:table-bodyfont-family | font-size |
fo:table-cellbackground-color | border-style | border-width |
fo:table-columncolumn-width |
fo:table-rowline-height |

Warning! These examples are related to XSL FO Working Draft, you need to use attribute "page-sequence/@master-reference" instead of "page-sequence/@master-name".



Source

<fo:root Surfns:fo="http://www.w3.org/1999/XSL/Format" >
     <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>
     <fo:page-sequence master-name="first">
          <fo:flow flow-name="xsl-region-body">
               <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"> How to use table elements </fo:block>
               <fo:block font-size="16pt" font-family="sans-serif" space-after.optimum="15pt" text-align="center"> A simple table, 3 columns, 4 rows </fo:block>
               <fo:block text-align="start">this is normal text. this is normal text. this is normal text. this is normal text. this is normal text. this is normal text. </fo:block>
               <fo:table>
                    <fo:table-column column-width="50mm"/>
                    <fo:table-column column-width="50mm"/>
                    <fo:table-column column-width="50mm"/>
                    <fo:table-body>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block>good</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>bad</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>ugly</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block>nice</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>dice</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>vice</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block>literature</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>music</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>art</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block>java</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>perl</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>python</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                    </fo:table-body>
               </fo:table>
               <fo:block text-align="start">this is normal text. this is normal text. this is normal text. this is normal text. this is normal text. this is normal text. </fo:block>
               <fo:block font-size="16pt" font-family="sans-serif" space-after.optimum="15pt" text-align="center" break-before="page"> A table with borders </fo:block>
               <fo:block text-align="start">this is normal text. this is normal text. this is normal text. this is normal text. this is normal text. this is normal text. </fo:block>
               <fo:table border-width="0.5mm" border-style="solid" background-color="yellow">
                    <fo:table-column column-width="50mm"/>
                    <fo:table-column column-width="50mm"/>
                    <fo:table-column column-width="50mm"/>
                    <fo:table-body>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block>good</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>bad</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>ugly</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block>nice</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>dice</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>vice</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block>literature</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>music</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>art</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block>java</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>perl</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>python</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                    </fo:table-body>
               </fo:table>
               <fo:block text-align="start">this is normal text. this is normal text. this is normal text. this is normal text. this is normal text. this is normal text. </fo:block>
               <fo:block font-size="16pt" font-family="sans-serif" space-after.optimum="15pt" text-align="center" break-before="page"> A table with thick borders </fo:block>
               <fo:block text-align="start">this is normal text. this is normal text. this is normal text. this is normal text. this is normal text. this is normal text. </fo:block>
               <fo:table border-width="3mm" border-style="solid" background-color="yellow">
                    <fo:table-column column-width="50mm"/>
                    <fo:table-column column-width="50mm"/>
                    <fo:table-column column-width="50mm"/>
                    <fo:table-body>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block>good</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>bad</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>ugly</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block>nice</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>dice</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>vice</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block>literature</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>music</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>art</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell>
                                   <fo:block>java</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>perl</fo:block>
                              </fo:table-cell>
                              <fo:table-cell>
                                   <fo:block>python</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                    </fo:table-body>
               </fo:table>
               <fo:block text-align="start" start-indent="-3mm">this is normal text. this is normal text. this is normal text. this is normal text. this is normal text. this is normal text. </fo:block>
               <fo:block font-size="16pt" font-family="sans-serif" space-after.optimum="15pt" text-align="center" break-before="page"> A table with borders around the cells </fo:block>
               <fo:block text-align="start">this is normal text. this is normal text. this is normal text. this is normal text. this is normal text. this is normal text. </fo:block>
               <fo:table>
                    <fo:table-column column-width="50mm"/>
                    <fo:table-column column-width="50mm"/>
                    <fo:table-column column-width="50mm"/>
                    <fo:table-body>
                         <fo:table-row>
                              <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow">
                                   <fo:block>good</fo:block>
                              </fo:table-cell>
                              <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow">
                                   <fo:block>bad</fo:block>
                              </fo:table-cell>
                              <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow">
                                   <fo:block>ugly</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow">
                                   <fo:block>nice</fo:block>
                              </fo:table-cell>
                              <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow">
                                   <fo:block>dice</fo:block>
                              </fo:table-cell>
                              <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow">
                                   <fo:block>vice</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow">
                                   <fo:block>literature</fo:block>
                              </fo:table-cell>
                              <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow">
                                   <fo:block>music</fo:block>
                              </fo:table-cell>
                              <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow">
                                   <fo:block>art</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow">
                                   <fo:block>java</fo:block>
                              </fo:table-cell>
                              <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow">
                                   <fo:block>perl</fo:block>
                              </fo:table-cell>
                              <fo:table-cell border-width="0.5mm" border-style="solid" background-color="yellow">
                                   <fo:block>python</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                    </fo:table-body>
               </fo:table>
               <fo:block text-align="start">this is normal text. this is normal text. this is normal text. this is normal text. this is normal text. this is normal text. </fo:block>
               <fo:block font-size="16pt" font-family="sans-serif" space-after.optimum="15pt" text-align="center" break-before="page"> 2 tables with thick borders around the cells </fo:block>
               <fo:block text-align="start">this is normal text. this is normal text. this is normal text. this is normal text. this is normal text. this is normal text. </fo:block>
               <fo:table>
                    <fo:table-column column-width="50mm"/>
                    <fo:table-column column-width="50mm"/>
                    <fo:table-column column-width="50mm"/>
                    <fo:table-body>
                         <fo:table-row>
                              <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow">
                                   <fo:block>good</fo:block>
                              </fo:table-cell>
                              <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow">
                                   <fo:block>bad</fo:block>
                              </fo:table-cell>
                              <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow">
                                   <fo:block>ugly</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow">
                                   <fo:block>nice</fo:block>
                              </fo:table-cell>
                              <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow">
                                   <fo:block>dice</fo:block>
                              </fo:table-cell>
                              <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow">
                                   <fo:block>vice</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow">
                                   <fo:block>literature</fo:block>
                              </fo:table-cell>
                              <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow">
                                   <fo:block>music</fo:block>
                              </fo:table-cell>
                              <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow">
                                   <fo:block>art</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                         <fo:table-row>
                              <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow">
                                   <fo:block>java</fo:block>
                              </fo:table-cell>
                              <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow">
                                   <fo:block>perl</fo:block>
                              </fo:table-cell>
                              <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow">
                                   <fo:block>python</fo:block>
                              </fo:table-cell>
                         </fo:table-row>
                    </fo:table-body>
               </fo:table>
               <fo:block text-align="start">this is normal text. this is normal text. this is normal text. this is normal text. this is normal text. this is normal text. </fo:block>
               <fo:table>
                    <fo:table-column column-width="50mm"/>
                    <fo:table-column column-width="50mm"/>
                    <fo:table-column column-width="50mm"/>
                    <fo:table-body>
                         <fo:table-row>
                              <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow">
                                   <fo:block>good</fo:block>
                              </fo:table-cell>
                              <fo:table-cell border-width="2mm" border-style="solid" background-color="yellow">
                                   <fo:block>bad</fo:block>
                              </fo:table-cell>
                              <fo:table-cell