RE: Question on behavior

Thu, 19 Jul 2001 23:18:20 -0700

Take a look at
http://www.w3.org/TR/2000/CR-xsl-20001121/xslspec.html#section-N14029-Format
ting-Objects-for-Tables. It explains really well how you can create tables
using FO.

I've included below an example from my project where I have one XSL sample
that produces a table in HTML and another that produces the same table in
PDF.

Regards,

Mike

  <xsl:template match="Databruk">
    <TABLE BORDER="1">
      <TR>
        <TH COLSPAN="2">Item</TH><TH>N&#248;dvendig</TH>
      </TR>
      <xsl:for-each select="Item">
        <TR>
          <TD><xsl:value-of select="Label"/></TD>
          <TD><xsl:value-of select="Name"/></TD>
          <TD ALIGN="CENTER"><xsl:value-of select="Mandatory"/></TD>
        </TR>
      </xsl:for-each>
    </TABLE>
  </xsl:template>

  <xsl:template match="Databruk">
    <fo:table space-before="12pt" font-size="80%">
      <fo:table-column column-width="210pt"/>
      <fo:table-column column-width="210pt"/>
      <fo:table-column column-width="70pt"/>
      <fo:table-body>
        <fo:table-row>
          <fo:table-cell number-columns-spanned="2"
                         border-top-style="solid" border-start-style="solid"
                         border-bottom-style="solid"
border-end-style="solid"
                         border-top-width="thin" border-start-width="thin"
                         border-bottom-width="thin" border-end-width="thin"

          >
            <fo:block font-weight="bold" text-align="center">
              Item
            </fo:block>
          </fo:table-cell>
          <fo:table-cell border-top-style="solid" border-start-style="solid"
                         border-bottom-style="solid"
border-end-style="solid"
                         border-top-width="thin" border-start-width="thin"
                         border-bottom-width="thin" border-end-width="thin"
          >
            <fo:block font-weight="bold" text-align="center">
              N&#248;dvendig
            </fo:block>
          </fo:table-cell>
        </fo:table-row>
        <xsl:for-each select="Item">
          <fo:table-row keep-with-previous="always">
            <fo:table-cell border-top-style="solid"
border-start-style="solid"
                           border-bottom-style="solid"
border-end-style="solid"
                           border-top-width="thin" border-start-width="thin"
                           border-bottom-width="thin"
border-end-width="thin"
            >
              <fo:block margin-left="2pt">
                <xsl:value-of select="Label"/>
              </fo:block>
            </fo:table-cell>
            <fo:table-cell border-top-style="solid"
border-start-style="solid"
                           border-bottom-style="solid"
border-end-style="solid"
                           border-top-width="thin" border-start-width="thin"
                           border-bottom-width="thin"
border-end-width="thin"
            >
              <fo:block margin-left="2pt">
                <xsl:value-of select="Name"/>
              </fo:block>
            </fo:table-cell>
            <fo:table-cell border-top-style="solid"
border-start-style="solid"
                           border-bottom-style="solid"
border-end-style="solid"
                           border-top-width="thin" border-start-width="thin"
                           border-bottom-width="thin"
border-end-width="thin"
            >
              <fo:block text-align="center">
                <xsl:value-of select="Mandatory"/>
              </fo:block>
            </fo:table-cell>
          </fo:table-row>
        </xsl:for-each>
      </fo:table-body>
    </fo:table>
  </xsl:template>

-----Original Message-----
From: Laurent FRANCOIS [mailto:[EMAIL PROTECTED]]
Sent: 19. juli 2001 18:09
To: [EMAIL PROTECTED]
Subject: Question on <table> behavior


I would like to use the same XML content which is used to be display on a 
browser to build a pdf file.

But i have a probleme with the <table><tr><td> behavior.

So my question is, how can i build table with FOP which looks like a table 
on a browser ?

Thanks.

Laurent


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to