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

Proportional table cells like in HTML

Expand Messages
  • hian0015
    Hi, The contents of my source XML-File are very different so I can t specify a width for the cell or the column (and I have also a different count of columns).
    Message 1 of 6 , Apr 10, 2002
      Hi,

      The contents of my source XML-File are very different so I can't
      specify a width for the cell or the column (and I have also a
      different count of columns).
      My problem is the I want proportional widths of the cells like in
      HTML, for example I have a cell with a questiontext and a cell with a
      checkbox. And when I generate a PDF (with renderx), both cells have
      the same width, but in HTML the cell with much text is big and the
      cell with the checkbox is small.
      Is this possible and which attributes do I have to use?
      Thanks

      Andreas <hiltschi@...>
    • G. Ken Holman
      ... The object has the column-width= property where you can specify proportional widths using the proportional-column-width() function call. For
      Message 2 of 6 , Apr 10, 2002
        At 2002-04-10 13:59 +0000, Andreas <hiltschi@...> wrote:
        >My problem is the I want proportional widths of the cells
        >...
        >Is this possible and which attributes do I have to use?

        The <table-column> object has the column-width= property where you can
        specify proportional widths using the proportional-column-width() function
        call.

        For example, if you wanted the first column to be one-tenth of the table
        width, you need only specify a proportion where the first column's argument
        value is one tenth of the sum of all columns' arguments:

        <table
        <table-column column-width="proportional-column-width(1)"/>
        <table-column column-width="proportional-column-width(9)"/>
        <table-body
        ...

        Note that if any of the columns have an explicit value for their width, the
        proportion is calculated from the remainder of unspecified column widths.

        I hope this helps.

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


        --
        Upcoming: 3-days XSLT/XPath and/or 2-days XSLFO: June 17-21, 2002
        - : 3-days XML Information Modeling: July 31-August 2, 2002

        G. Ken Holman mailto:gkholman@...
        Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
        Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (Fax:-0995)
        ISBN 0-13-065196-6 Definitive XSLT & XPath
        ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath
        ISBN 1-894049-07-1 Practical Formatting Using XSLFO
        XSL/XML/DSSSL/SGML/OmniMark services, books(electronic, printed),
        articles, training(instructor-live,Internet-live,web/CD,licensed)
        Next public training: 2002-04-08,09,10,11,05-06,07,09,10,13,20,
        - 06-04,07,10,11,13,14,17,20,07-31
      • hian0015
        HI. Unfortunately, this doesn t help because during the generation I don t know wheather the content of each cell is long or short, so I can t specify the
        Message 3 of 6 , Apr 10, 2002
          HI.

          Unfortunately, this doesn't help because during the generation I
          don't know wheather the content of each cell is long or short, so I
          can't specify the proportion in the table-column.
          My wish is, that the processor automatically sees, wheather the
          content is long or short (like a html-interpreter)

          Nevertheless thanks, Andreas
        • G. Ken Holman
          ... I m sorry I read too much into your requirements ... but what you are asking for is the default behaviour. I just created the test below and have attached
          Message 4 of 6 , Apr 10, 2002
            At 2002-04-10 16:13 +0000, Andreas <hiltschi@...> wrote:
            >Unfortunately, this doesn't help because during the generation I
            >don't know wheather the content of each cell is long or short, so I
            >can't specify the proportion in the table-column.
            >My wish is, that the processor automatically sees, wheather the
            >content is long or short (like a html-interpreter)

            I'm sorry I read too much into your requirements ... but what you are
            asking for is the default behaviour.

            I just created the test below and have attached a screen capture of the
            interpretation of the file.

            I hope this helps.

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


            <?xml version="1.0" encoding="utf-8"?><!--table.fo-->
            <!DOCTYPE root [ <!ENTITY % pages SYSTEM "pages.ent"> %pages;
            <!ENTITY nbsp " ">]>
            <root font-family="Times" font-size="14pt"
            xmlns="http://www.w3.org/1999/XSL/Format">

            <layout-master-set>
            <simple-page-master master-name="frame"
            page-height="&page-height;" page-width="&page-width;"
            margin-top="&margin-top;" margin-bottom="&margin-bottom;"
            margin-left="&margin-left;" margin-right="&margin-right;">
            <region-body region-name="frame-body"
            margin-top="&before-extent;" margin-bottom="&after-extent;"/>
            <region-before extent="&before-extent;"
            region-name="frame-before"/>
            <region-after extent="&after-extent;"
            region-name="frame-after"/>
            </simple-page-master>
            <page-sequence-master master-name="frame-pages">
            <single-page-master-reference master-reference="frame"/>
            </page-sequence-master>
            </layout-master-set>

            <page-sequence master-reference="frame-pages">

            <flow flow-name="frame-body">

            <block>First test</block>
            <table>
            <table-body>
            <table-cell border="solid">
            <block>Hello</block>
            </table-cell>
            <table-cell border="solid">
            <block>This is a test of a long cell</block>
            </table-cell>
            </table-body>
            </table>
            <block>Second test</block>
            <table>
            <table-body>
            <table-cell border="solid">
            <block></block>
            </table-cell>
            <table-cell border="solid">
            <block>The cell at left is empty</block>
            </table-cell>
            </table-body>
            </table>
            <block>Third test</block>
            <table>
            <table-body>
            <table-cell border="solid">
            <block> </block>
            </table-cell>
            <table-cell border="solid">
            <block>The cell at left has an &nbsp;</block>
            </table-cell>
            </table-body>
            </table>
            <block>Fourth test</block>
            <table>
            <table-body>
            <table-cell border="solid">
            <block-container width="1em"/>
            </table-cell>
            <table-cell border="solid">
            <block>The cell at left has a block container of 1em width</block>
            </table-cell>
            </table-body>
            </table>

            </flow></page-sequence></root>
          • hian0015
            Hi. I have tested your source and I had the same result as before. I think I have to test the antennahouse Transformator instead of the one of renderx. Thank
            Message 5 of 6 , Apr 10, 2002
              Hi.

              I have tested your source and I had the same result as before. I
              think I have to test the antennahouse Transformator instead of the
              one of renderx. Thank you for your help. I will post my results.

              Regards,

              Andreas
            • hian0015
              Hi. With the FO-Generator of Antennahouse it works like I want! It generates proprotinal table cells depending on the content. The Formatter of RenderX does
              Message 6 of 6 , Apr 11, 2002
                Hi.

                With the FO-Generator of Antennahouse it works like I want! It
                generates proprotinal table cells depending on the content.
                The Formatter of RenderX does not do this by default.

                Bye.
              Your message has been successfully submitted and would be delivered to recipients shortly.