How does proportional-column-width work in xsl fo

ank5
ank5 used Ask the Experts™
on
How does proportional-column-width work? In the below example, what would 1 or 3.5 or 2 mean? Should these total to 10 which would make it 100%? or should I be specifying percentages instead?

<fo:table-column column-width="proportional-column-width(1)"/>
						<fo:table-column column-width="proportional-column-width(3.5)"/>
						<fo:table-column column-width="proportional-column-width(.8)"/>
						<fo:table-column column-width="proportional-column-width(2)"/>
						<fo:table-column column-width="proportional-column-width(1)"/>
						<fo:table-column column-width="proportional-column-width(2)"/>
						<fo:table-column column-width="proportional-column-width(1.5)"/>

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Gertone (Geert Bormans)Information Architect
Top Expert 2006

Commented:
It is "proportional" compared to the other columns
the fourth column will have twice the width of the fifth column
as 2 to 1 in the proportional width

basically you can add all the proportional widths together, divide 100 by that total and for each column multiply by the proportional width value to get the % width

Author

Commented:
Is it possible to simply specify %?
Gertone (Geert Bormans)Information Architect
Top Expert 2006

Commented:
yes as width on the column
Information Architect
Top Expert 2006
Commented:
In fact is the proportional-column-width(3.5) a transformation convenience
It is an easy way to put in whatever value you find in the XML you want to transform into FO
and let the FO processor sort the sizes out
If you need to do complex calculations to get to the proportional width, you would be doing the wrong thing

note
<fo:table-column column-width="proportional-column-width(30)"/>
<fo:table-column column-width="proportional-column-width(40)"/>
<fo:table-column column-width="proportional-column-width(30)"/>

Open in new window


would render exactly the same as
<fo:table-column column-width="30%"/>
<fo:table-column column-width="40%"/>
<fo:table-column column-width="30%"/>

Open in new window


The only difference is that with the first you don't  need to worry about the numbers adding up to 100, and in the second example you do need to worry...
I use proportional-width a lot for that reason

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial