xsl-list
[Top] [All Lists]

Re: [xsl] Need Math Help: How to Convert Proportional Column Widths to Real Values?

2015-12-30 11:24:51
I was looking to do something similar and found this question. In my
case, I don't have the total table column width always. So, if I have
a mixed col width values of 1.38,1.38.1*,1.38, how can I find the real
value for 1*?

As Eliot mentioned, some absolute total value is required. Unless you are e.g. 
in an FO environment, where 100% can be seen as the current available width. 

In a more general way I did it something like this:

* Columns without width or just "*" are treated as "1*"
* Calculate the sum of all relative widths (SumRW)
* Calculate the sum of all absolute widths (SumAW)

* Calculate remaining width RestRW := Total - SumAW
  - If it is ≤ 0 we have a problem
  - Else each remaining column width is ColRW / SumRW multiplied with the RestRW

- Michael
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [xsl] Need Math Help: How to Convert Proportional Column Widths to Real Values?, Michael Müller-Hillebrand mmh@docufy.de <=