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

Question about tables

Expand Messages
  • gpearson_ccc <gpearson@creativecorp.com>
    There seems to be (in my mind) a deficiency in the fo:table specification, but maybe I m not doing something optimally. Here is my dilemma: I have put
    Message 1 of 4 , Jan 7, 2003
    • 0 Attachment
      There seems to be (in my mind) a deficiency in the fo:table
      specification, but maybe I'm not doing something optimally. Here is
      my dilemma:

      I have put together stylesheets to convert both HTML and CALS tables
      to FO. Both the HTML and CALS table models allow specification of
      both border and frame (or their equivalent) at a level other than
      cell. For example, in HTML, one can specify, at the table level,
      frame="void"
      rules="all"
      which means don't draw a box around the table, but draw lines between
      each of the cells. CALS tables have a similar notion.

      I can't figure out a way to mimic this behavior in FO except to know
      exactly what to do with each cell. The problem with dealing with
      this problem at the cell level is that I would need to know, in my
      stylesheet, where every cell is in relation to other cells within a
      row. This is not easy if cells span columns and rows (otherwise I
      could just check preceding and following peers).

      The only way I can see to do this is to know exactly what the cell
      layout on every row is, which is pretty much what the formatter needs
      to know anyway. If my stylesheet needs the same smarts as the
      formatter, this kind of defeats the purpose of using a formatter in
      the first place. It would be nice to be able to say at a higher
      level to draw lines between cells, however they are arranged.

      Am I missing something?
    • G. Ken Holman
      ... Perhaps you are missing the precedence of co-incident borders ... you can specify the table border separately from specifying a border on each of the
      Message 2 of 4 , Jan 7, 2003
      • 0 Attachment
        At 2003-01-07 20:58 +0000, gpearson_ccc <gpearson@...> wrote:
        >I have put together stylesheets to convert both HTML and CALS tables
        >to FO. Both the HTML and CALS table models allow specification of
        >both border and frame (or their equivalent) at a level other than
        >cell. For example, in HTML, one can specify, at the table level,
        > frame="void"
        > rules="all"
        >which means don't draw a box around the table, but draw lines between
        >each of the cells. CALS tables have a similar notion.
        >
        >I can't figure out a way to mimic this behavior in FO except to know
        >exactly what to do with each cell.
        >...
        >It would be nice to be able to say at a higher
        >level to draw lines between cells, however they are arranged.
        >
        >Am I missing something?

        Perhaps you are missing the precedence of co-incident borders ... you can
        specify the table border separately from specifying a border on each of the
        cells. And you don't have to know the dimensions of the cells to turn on
        their borders.

        The initial values for border precedence are: fo:table: 6, fo:table-cell:
        5, fo:table-column: 4, fo:table-row: 3, fo:table-body: 2, fo:table-header:
        1, fo:table-footer: 0, though these can be tweaked if need be.

        Set the border for the table and then the border for every cell and
        precedence should handle the rest for you.

        Note there are two values for the "no border" style, one of higher
        precedence than all border styles ("hidden") and one of lower precedence
        than all border styles ("none").

        I hope this helps.

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


        --
        Upcoming hands-on in-depth North America: February 3- 7,2003
        XSLT/XPath and XSL-FO Europe: February 17-21,2003

        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)
        ISBN 0-13-065196-6 Definitive XSLT and XPath
        ISBN 0-13-140374-5 Definitive XSL-FO
        ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath
        ISBN 1-894049-10-1 Practical Formatting Using XSL-FO
        Male Breast Cancer Awareness http://www.CraneSoftwrights.com/f/bc
      • gpearson_ccc <gpearson@creativecorp.com>
        OK, I did some reading up on this, so I d like to get my conclusions verified: Assume I need to do a table with no surrounding border, but with borders
        Message 3 of 4 , Jan 8, 2003
        • 0 Attachment
          OK, I did some reading up on this, so I'd like to get my conclusions
          verified:

          Assume I need to do a table with no surrounding border, but with
          borders separating all rows and columns, regardless of cell spans and
          layout (sort of like a tic-tac-toe layout).

          If I specify border-collapse="collapse-with-precedence", then specify
          at the table level no border (how do I do this...border-width of 0?),
          then specify surrounding borders for each cell, will this accomplish
          what I want to do? In other words, does this direct FO to ignore the
          left border for left-most cells?

          I think my other problem is that I am using XEP as my formatting
          engine, and they apparently don't support this option for collapse-
          border values.

          --- In XSL-FO@yahoogroups.com, "G. Ken Holman" <gkholman@c...> wrote:
          > At 2003-01-07 20:58 +0000, gpearson_ccc <gpearson@c...> wrote:
          > >I have put together stylesheets to convert both HTML and CALS
          tables
          > >to FO. Both the HTML and CALS table models allow specification of
          > >both border and frame (or their equivalent) at a level other than
          > >cell. For example, in HTML, one can specify, at the table level,
          > > frame="void"
          > > rules="all"
          > >which means don't draw a box around the table, but draw lines
          between
          > >each of the cells. CALS tables have a similar notion.
          > >
          > >I can't figure out a way to mimic this behavior in FO except to
          know
          > >exactly what to do with each cell.
          > >...
          > >It would be nice to be able to say at a higher
          > >level to draw lines between cells, however they are arranged.
          > >
          > >Am I missing something?
          >
          > Perhaps you are missing the precedence of co-incident borders ...
          you can
          > specify the table border separately from specifying a border on
          each of the
          > cells. And you don't have to know the dimensions of the cells to
          turn on
          > their borders.
          >
          > The initial values for border precedence are: fo:table: 6, fo:table-
          cell:
          > 5, fo:table-column: 4, fo:table-row: 3, fo:table-body: 2, fo:table-
          header:
          > 1, fo:table-footer: 0, though these can be tweaked if need be.
          >
          > Set the border for the table and then the border for every cell and
          > precedence should handle the rest for you.
          >
          > Note there are two values for the "no border" style, one of higher
          > precedence than all border styles ("hidden") and one of lower
          precedence
          > than all border styles ("none").
          >
          > I hope this helps.
          >
          > ................ Ken
          >
          >
          > --
          > Upcoming hands-on in-depth North America: February 3- 7,2003
          > XSLT/XPath and XSL-FO Europe: February 17-21,2003
          >
          > G. Ken Holman mailto:gkholman@C...
          > Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
          > Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
          > ISBN 0-13-065196-6 Definitive XSLT and XPath
          > ISBN 0-13-140374-5 Definitive XSL-FO
          > ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath
          > ISBN 1-894049-10-1 Practical Formatting Using XSL-FO
          > Male Breast Cancer Awareness http://www.CraneSoftwrights.com/f/bc
        • G. Ken Holman
          ... Ummmmmm .... you cannot border rows and columns if the cells span them ... you can border the cells and where they are coincident with rows and columns
          Message 4 of 4 , Jan 8, 2003
          • 0 Attachment
            At 2003-01-08 17:43 +0000, gpearson_ccc <gpearson@...> wrote:
            >OK, I did some reading up on this, so I'd like to get my conclusions
            >verified:
            >
            >Assume I need to do a table with no surrounding border, but with
            >borders separating all rows and columns, regardless of cell spans and
            >layout (sort of like a tic-tac-toe layout).

            Ummmmmm .... you cannot border rows and columns if the cells span them ...
            you can border the cells and where they are coincident with rows and
            columns then style or numeric precedence will come into play.

            >If I specify border-collapse="collapse-with-precedence",

            Yes, but the default "collapse" works as well because you can use style
            precedence.

            >then specify
            >at the table level no border (how do I do this...border-width of 0?),

            That, or border-style="hidden" to give it higher precedence than the cells.

            >then specify surrounding borders for each cell, will this accomplish
            >what I want to do? In other words, does this direct FO to ignore the
            >left border for left-most cells?

            Yes. The example below gives me the tic-tac-toe you mentioned when using
            Antenna House.

            >I think my other problem is that I am using XEP as my formatting
            >engine, and they apparently don't support this option for collapse-
            >border values.

            That will give you problems, yes ... you will have to work at a
            cell-by-cell basis turning of that cell's sides, because the table's border
            is not coincident with the cells' borders.

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

            <table border-style="hidden">
            <table-body>
            <table-row>
            <table-cell border-style="solid">
            <block>x</block>
            </table-cell>
            <table-cell border-style="solid">
            <block>x</block>
            </table-cell>
            <table-cell border-style="solid">
            <block>x</block>
            </table-cell>
            </table-row>
            <table-row>
            <table-cell border-style="solid">
            <block>x</block>
            </table-cell>
            <table-cell border-style="solid">
            <block>x</block>
            </table-cell>
            <table-cell border-style="solid">
            <block>x</block>
            </table-cell>
            </table-row>
            <table-row>
            <table-cell border-style="solid">
            <block>x</block>
            </table-cell>
            <table-cell border-style="solid">
            <block>x</block>
            </table-cell>
            <table-cell border-style="solid">
            <block>x</block>
            </table-cell>
            </table-row>
            </table-body>
            </table>


            --
            Upcoming hands-on in-depth North America: February 3- 7,2003
            XSLT/XPath and XSL-FO Europe: February 17-21,2003

            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)
            ISBN 0-13-065196-6 Definitive XSLT and XPath
            ISBN 0-13-140374-5 Definitive XSL-FO
            ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath
            ISBN 1-894049-10-1 Practical Formatting Using XSL-FO
            Male Breast Cancer Awareness http://www.CraneSoftwrights.com/f/bc
          Your message has been successfully submitted and would be delivered to recipients shortly.