Wednesday, 6 August 2003

More table centring

Wednesday, 6 August 2003 12:39
pne: A picture of a plush toy, halfway between a duck and a platypus, with a green body and a yellow bill and feet. (Default)

It seems that XSL-FO has decided to use, MSIE-style, text-align to centre tables, rather than controlling the centring by setting the margins to equal values.

This means that if you want to centre a table-with-caption but have the cell contents default (start) aligned, you need something like

<fo:table-and-caption text-align="center">
  <fo:table-caption text-align="start">
    <fo:block>Table caption goes here</fo:block>
  </fo:table-caption>

  <fo:table […]>
    [… column definitions …]
    <fo:table-body text-align="start">
      [… table rows and cells …]
    </fo:table-body>
  </fo:table>
<fo:table-and-caption>

Foo.

Profile

pne: A picture of a plush toy, halfway between a duck and a platypus, with a green body and a yellow bill and feet. (Default)
Philip Newton

June 2015

S M T W T F S
 12 3456
78910111213
14151617181920
2122232425 2627
282930    

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Thursday, 1 January 2026 01:32
Powered by Dreamwidth Studios