W3C home > Mailing lists > Public > www-xsl-fo@w3.org > May 2008

Re: more advanced table column aligning

From: Tony Graham <Tony.Graham@MenteithConsulting.com>
Date: Tue, 06 May 2008 23:15:02 +0100
To: www-xsl-fo@w3.org
Message-ID: <87wsm7t6zd.fsf@zako.menteithconsulting.com>

On Fri, May 02 2008 22:06:39 +0100, armyofda12mnkeys@gmail.com wrote:
> i was requested to change my columns of a table i made from center
> aligned to flush right since the table cells were numbers like $10.00
> and needed to be aligned.
> and I did that. but then the clients wanted the header row columns
> centered over those flush right columns. kinda got stumped. i thought
> easiest way would be to leave all the table cells  (header and data
> rows) flush right but apply negative margins to the right side of the
> header row's cells (so slightly moving those columns to the right).
> That didnt seem to work (negative margins werent respected in newest
> FOP). Then I changed the header columns back to center align but left
> the data columns at flush right, and applied regular right margins to
> each data cell. So basically moved the columns to look like they are
> centered. This was alot more work.
> Is there a better way to do this?

There's also:

   text-align="." (which may need to be text-align="'.'")

for aligning on the decimal point, although YMMV about whether your
processor does the right thing or not.

See [1], which refers to [2].

Since neither XSL 1.1 nor CSS2 say where to put the alignment character,
the XSL 2.0 requirements draft discusses specification of the alignment
position [3].

In the absence of text-align="." (and XSL 2.0), you've probably done the
best you can.

Regards,


Tony Graham                         Tony.Graham@MenteithConsulting.com
Director                                  W3C XSL FO SG Invited Expert
Menteith Consulting Ltd
XML, XSL and XSLT consulting, programming and training
Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
Registered in Ireland - No. 428599   http://www.menteithconsulting.com
  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
xmlroff XSL Formatter                               http://xmlroff.org
xslide Emacs mode                  http://www.menteith.com/wiki/xslide
Unicode: A Primer                               urn:isbn:0-7645-4625-2


[1] http://www.w3.org/TR/xsl11/#text-align
[2] http://www.w3.org/TR/1998/REC-CSS2/tables.html#column-alignment
[3] http://www.w3.org/TR/2008/WD-xslfo20-req-20080326/#N66218
Received on Tuesday, 6 May 2008 22:15:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 6 May 2008 22:15:54 GMT