XP Mail Archive: Re: XP> Table column width algorithms

Re: XP> Table column width algorithms

From: ElliottBradshaw@oaktech.com
Date: Fri Nov 15 2002 - 14:01:54 EST

  • Next message: don@lexmark.com: "Re: XP> Table column width algorithms"

    A printer has two challenges that don't affect a browser (much...):

    1. The @page rule allows an author to create a document with multiple page
    styles, and different pages can have different widths available for
    content.

    2. There is no scrollbar on a printer, so we are highly motivated to
    compress a table to make it fit on the width of a page.

    Thus, it is conceivable that a printer might find itself with a table with
    wide content on one page, but which flows onto a narrower page. An
    advanced algorithm might take advantage of this and change the column
    widhts to better fit on the new page. If the new page is narrower than the
    first, reducing column width is probably bettter than falling off the edge
    of the page.

    Does this create problems for the user? I don't think it necessarily does.
    I think it is OK for XHTML-Print to allow this; although certainly we
    don't want to require it.

      E.

    ------------------------------------------
    Elliott Bradshaw
    Director, Software Engineering
    Oak Technology Imaging Group
    781 638-7534

                                                                                                     
                        "SILBERNAGEL,SCO
                        TT To: "'xp@pwg.org'" <xp@pwg.org>
                        (HP-Vancouver,ex cc:
                        1)" Subject: XP> Table column width algorithms
                        <scott_silbernag
                        el@hp.com>
                        Sent by:
                        owner-xp@pwg.org
                                                                                                     
                                                                                                     
                        11/15/2002 01:53
                        PM
                                                                                                     
                                                                                                     

    Hello,

    The following are comments to the latest update slides from the New Orleans
    PWG meeting.

    Taken from Slide #22:

    XHTML-Print: 3.8 Basic Tables Module
               · Column width may vary from page to page when width is
            determined by td content.

    Allowing column width to vary page to page would be inconsistent with the
    way table column widths are normally computed and rendered (in browsers and
    according to CSS2). Table columns are normally computed (and fixed for the
    entire table) solely on either: the first tr element and its child td/th
    elements (table-layout: fixed) -or- all tr and td/th elements in the table
    along with the contents of those td/th elements (table-layout: auto).

    When using the auto column width algorithm, column widths will be large
    enough to handle the widest td/th in the table and varying the column
    widths
    page by page would never be necessary. Unfortunately, a minimally
    conforming printer cannot be forced to use this algorithm since it is not
    always possible to store the entire table in memory.

    This leaves us with the fixed algorithm for computing column widths. With
    the fixed method, column widths are only computed by looking at the first
    tr
    element and the widths of the first rows cells. The CSS2 specification
    clearly states that the cells beyond the first table row do not affect
    column widths (section 17.5.2):

    <quote>
    In this manner, the user agent can begin to lay out the table once the
    entire first row has been received. Cells in subsequent rows do not affect
    column widths. Any cell that has content that overflows uses the 'overflow'
    property to determine whether to clip the overflow content.
    </quote>

    So, in my opinion, allowing varying column widths in a single table would
    conflict with statements made in the CSS2 spec as well the "standard"
    rendering of web pages by popular web browsers (IE, Opera,
    Mozilla/Netscape).

    Other questions/concerns:

    If we did allow table columns to vary page-by-page, how would this behavior
    affect table cells that span multiple pages? Would they suddenly get wider
    or narrower when crossing a page boundary or would we only vary column
    widths between rows? If we only varied between rows, the table would look
    pretty strange (cell borders between columns would not line up...).

    Scott Silbernagel
    Hewlett-Packard



    This archive was generated by hypermail 2b29 : Fri Nov 15 2002 - 14:04:30 EST