Loading ...
Sorry, an error occurred while loading the content.

Re: [XSL-FO] tables

Expand Messages
  • G. Ken Holman
    ... In XSL-FO, you can only get anything other than a fixed layout by using the default table-layout= which is auto (though not implemented by all
    Message 1 of 9 , Feb 13, 2004
    • 0 Attachment
      At 2004-02-13 19:16 +0100, Peter Billen wrote:
      >I was trying to make a table like this:
      >+ bla + this is a test +
      >+ bluuu + another one +
      >+ ... + .... +
      >where the first column uses as less space as needed.

      In XSL-FO, you can only get anything other than a fixed layout by using the
      default table-layout= which is "auto" (though not implemented by all

      When your table width is not 100%, then automatic layout typically uses "as
      less space as needed", though even with HTML automatic layout will
      sometimes wrap table contents undesirably.

      >This doesn't seem to work, it seems both columns use 50% of the horizontal
      >space, instead of something like 5% and 95%.

      Anything is allowed to happen because automatic layout is implementation
      defined. There are no guidelines for how to implement "automatic layout"
      ... section 7.26.16 says "any" algorithm.

      >I thought by setting the width
      >of the first column to 0%, it would use as less space as needed.

      The problem is with your specification of 100% for the second column ...
      XSL-FO allows you to go beyond the width of a table, so when you use 100%
      for the second column, it extends over the end of the table by as long as
      the first column is.

      >This works perfect in HTML.

      Really?? Is that by definition or is that by coincidence? I never realized
      one had such control in HTML ... when your rows have different makeup in
      each of the first columns, how does the browser choose which of the rows to
      use for establishing the width of the first column?

      >Do you guys have an idea? What I want is that the second column always start
      >at the same vertical position, so if you have another option, I'm glad to
      >hear it!

      The only guaranteed way I know of to do get close to you want, when you
      don't know the width of the first column, is to use side floats. Anything
      else in XSL-FO, lists, tables, etc., requires you to know in advance the
      width of the first column.

      Even then you aren't quite there, because when you have multiple rows, you
      cannot vertically align the content in the float with the content in the body.

      So, I think you can't have it both ways in XSL-FO. Either you specify the
      widths, or you let the engine do it for you ... I don't think you can mix
      the two for multiple rows for a table, having the second column of each row
      start at the same point when the content of the first column is arbitrary
      on every row.

      Sorry I can't help.

      ......................... Ken

      Public courses: upcoming world tour of hands-on XSL training events
      Each week: Monday-Wednesday: XSLT/XPath; Thursday-Friday: XSL-FO
      Washington, DC: 2004-03-15 San Francisco, CA: 2004-03-22
      Hong Kong: 2004-05-17 Germany: 2004-05-24 England: 2004-06-07
      World-wide on-site corporate, government & user group XML training!

      G. Ken Holman mailto:gkholman@...
      Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
      Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
      Male Breast Cancer Awareness http://www.CraneSoftwrights.com/f/bc
    Your message has been successfully submitted and would be delivered to recipients shortly.