xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ian Larner" <ian_lar...@uk.ibm.com>
Subject Re: Regarding creating a table
Date Tue, 15 Jan 2002 11:00:14 GMT

Meena,
FO tables have a completely different tag set.  Your table needs to be
transformed into something like:

<fo:table table-layout="fixed" space-before="10pt" space-after="10pt"
background-color="white"
start-indent="0pt" end-indent="24pt">
<fo:table-column column-number="1" column-width="4cm"/>
<fo:table-column column-number="2" column-width="4cm"/>
<fo:table-column column-number="3" column-width="6cm"/>
<fo:table-body background-color="white" border-style="solid" border-width
="1pt" border-color="black">
<fo:table-row>
<fo:table-cell color="black" background-color="#00FFFF" border-style
="solid" border-width="1pt" border-color="black" padding="2pt" font-size
="80%" column-number="1" number-rows-spanned="1">
<fo:block> <fo:inline font-weight="bold">INPUT AVAILABLE</fo:inline>
</fo:block>
</fo:table-cell>
<fo:table-cell color="black" background-color="#00FFFF" border-style
="solid" border-width="1pt" border-color="black" padding="2pt" font-size
="80%" column-number="2" number-rows-spanned="1">
<fo:block>
<fo:inline font-weight="bold">IMPLEMENTATION PROCESS</fo:inline>
</fo:block>
</fo:table-cell>
<fo:table-cell color="black" background-color="#00FFFF" border-style
="solid" border-width="1pt" border-color="black" padding="2pt" font-size
="80%" column-number="3" number-rows-spanned="1">
<fo:block>
<fo:inline font-weight="bold"> OUTPUT DISPLAYED</fo:inline>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>

</fo:table>

For this, you will need to create transforms for your html table elements:
   Transform <table into <fo:table, and add appropriate properties
   For each <td, create a <fo:table-column, and add a column-number and
   appropriate column-width. I think that the column-width value has to be
   a real value (it may be more flexible in FOP 0.20), which you can
   calculate in your transform
   For each <tr, create a <fo:table-row> and, for each <td, <fo:table-cell
   with appropriate properties and content.  In the example above, I have
   preserved the cell background color (background-color="#00FFFF"),
   assigned a solid black border (border-style="solid" border-width="1pt"
   border-color="black"), and scaled the text to 80% (font-size="80%")
   which in my documents gives a better text presentation and allows more
   text width in a table.

Regards,
Ian

Ian Larner
User Technologies, IBM Hursley Lab, England
email: ian_larner@uk.ibm.com

"The credit belongs to the man ...in the arena,  (who) knowing there is no
effort without ...shortcomings, actually strives to do the deeds..."
Theodore Roosevelt



                                                                                         
                         
                    "Meena"                                                              
                         
                    <meenakshi.sarvagopal@       To:     <fop-user@xml.apache.org>
                                
                    wipro.com>                   cc:                                  
                            
                                                 Subject:     Regarding creating a table 
                         
                    01/15/2002 10:26 AM                                                  
                         
                    Please respond to                                                    
                         
                    fop-user                                                             
                         
                                                                                         
                         
                                                                                         
                         





Hi,
I need to have table in my pdf output. My input xml  file is something like
tis

<chapter name="test">
<description>xyz</description>
<html>
   <body>
      <table border="1"  width="94%">
                   <tr>
                      <td width="27%"  bgcolor="#00FFFF">
                         <b>INPUT  AVAILABLE</b>
                      </td>
                      <td width="32%"  bgcolor="#00FFFF">
                         <b>IMPLEMENTATION  PROCESS</b>
                      </td>
                       <td width="41%"  bgcolor="#00FFFF">
                         <b> OUTPUT  DISPLAYED</b>
                      </td>
                   </tr>
        </table>
        </body>
    </html>
</chapter>

In my xsl, i use
<xsl:template match="chapter">
<xsl:when  test="name()='html'">
      <xsl:copy-of  select="."/>
</xsl:when>
----
----
</xsl:template>

And the .fo file has the copy of the the  <html> part is put into the .fo
file. But when converting into a pdf, i'm  not getting the <html> tags as a
proper table.
How can i achieve this?

Regds,
Meena.


#### Wipro_Disclaimer.txt has been removed from this note on January 15
2002 by Ian Larner




Mime
View raw message