Hi,

After going nuts for a day and a half and also trawling the archives of
fop-dev and fop-user and the FAQs, can anyone please enlighten me to
a) why the following code doesn't center the table and
b) how to do it !.

I've tried the FAQ from http://www.dpawson.co.uk/xsl/sect3/N8922.html#d65e78
, i.e.

<fo:table width="[X]" start-indent="(100% - [X]) div 2">

yet that applies the indent to the cells, not the table.

The snippet below attempts to use tables within a table cell using <fo:block
display-align="center">, however it still doesn't center the table!

I also tried ...

<fo:table table-layout="fixed" text-align="center">
from http://marc.theaimsgroup.com/?l=fop-dev&m=101318356612822&w=2
on fop-dev but no luck !.

The FAQ on http://www.owal.co.uk/cgi-bin/fopfaq.cgi#__993 asks the right
question but doesn't give an answer (the setting of display-align="center"
to the region body doesn't work.

I'm rendering using fop-0.20.3.

So here's my attempt at the table within a table solution from
http://marc.theaimsgroup.com/?l=fop-dev&m=100748671512873&w=2 below. I'm
rendering a table with two columns 74mm & 26mm in a table whose width is
200mm. (The code below is significantly cut down from what I'm actually
rendering).

If anyone can tell me the obvious mistake (if any) then I would much
appreciate it!.

Many thanks

Neil Cooper

----------------------------------------------------------------------------
-----------------------

<?xml version="1.0" encoding="utf-8"?>
<fo:root font-family="Helvetica"
         font-size="12pt"
         text-align="center"
         xmlns:fo="http://www.w3.org/1999/XSL/Format";>
<fo:layout-master-set>
<fo:simple-page-master master-name="a4"
                       page-height="297mm"
                       page-width="210mm"
                       margin-top="10mm"
                       margin-bottom="6mm"
                       margin-left="10mm"
                       margin-right="10mm">

<fo:region-body margin-top="0mm" margin-bottom="11mm"/>
<fo:region-before extent="0mm"/>
<fo:region-after extent="6mm"/>
</fo:simple-page-master>
</fo:layout-master-set>

<fo:page-sequence master-reference="a4">
  <fo:flow flow-name="xsl-region-body" >
    <fo:table>
      <fo:table-column column-width="200mm"/>
      <fo:table-body><fo:table-row><fo:table-cell
display-align="center"><fo:block>

        <fo:table>
          <fo:table-column column-width="26mm"/>
          <fo:table-column column-width="74mm"/>
          <fo:table-body font-family="Helvetica" font-size="10pt">
            <fo:table-row>
              <fo:table-cell border-width="0.05mm" border-style="double"
number-columns-spanned="1" >
                <fo:block text-align="left">Description</fo:block>
              </fo:table-cell>
              <fo:table-cell border-width="0.05mm" border-style="double"
number-columns-spanned="1" >
                <fo:block text-align="right">0</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:flow>
</fo:page-sequence>
</fo:root>



Reply via email to