[xep-support] <fo:table-column> ... why?

Patrick Goetz pgoetz at linuxcs.com
Fri Mar 27 09:21:45 PDT 2015


I was initially under the impression that the <fo:table-column> element 
implemented the functionality of the xhtml <col> tag; i.e. it specifies 
a set of formatting specifications for a particular column, or set of 
columns of table cells.

After some experimentation and upon re-reading the W3C spec, it's clear 
that this is only true for the column-width attribute.  Any other 
characteristic is elective.  For example, if I set

   <fo:table-column column-number="2" color="red"/>

The text in column 2 table cells will only be red if I specifically 
request this attribute using the from-table-column() function:

   <fo:table-cell color="from-table-column()">


Does anyone know why someone thought it was a good idea to design the 
spec this way?  It seems much more logical to have characteristics 
specified in the table-column apply to the entire column by default, 
particularly since you can always override them in individual 
table-cells when you need to.  And in particular, this makes it chore to 
transform xhtml <col> to xsl:fo.


Yet be to resolved is the mystery of the number-columns-spanned vs. 
number-columns-repeated attributes of <fo:table-column>.  Near as I can 
tell, number-columns-spanned doesn't do anything; i.e. if I specify

   fo:table-column column-number="2" number-columns-spanned="2" 
color="red"/>

then try using <fo:table-cell color="from-table-column()"> for a table 
cell in the 3rd column, nothing happens; i.e. the text is not rendered 
in red; however if I specify

   fo:table-column column-number="2" number-columns-repeated="2" 
color="red"/>

and then use <fo:table-cell color="from-table-column()"> for a 
table-cell in the 3rd column, then this does result in red text.

If someone knows what the purpose of number-columns-spanned is in 
<fo:table-column>, please share.

Thanks.




More information about the Xep-support mailing list