Re: [xep-support] Padding within cells of proportional-width table columns?

From: Alexander Peshkov (peshkov@renderx.com)
Date: Tue Aug 10 2004 - 01:20:02 PDT

  • Next message: Alexander Peshkov: "Re: [xep-support] Mixing Chinese and English fonts"

    Hello Tim,

    The behavior you observe is correct according to XSL-FO spec and
    caused by the way margins/indents are calculated.
    This topic was discussed on this list quite a while ago, you may want
    to search archives for the subject "Understanding area rectangles".
    The short answer is that you have to set margin="0pt" on fo:blocks in
    addition to the padding in order to get expected behavior.

    Best regards,
    Alexander Peshkov mailto:peshkov@renderx.com
    RenderX

    DTS> I have a table that uses proportional widths for its columns, and I want to pad the cells of those columns. One version I have tried looks like this:

    DTS> <fo:table table-layout="fixed" inline-progression-direction="100%" ...>
    DTS> <fo:table-column column-width="proportional-column-width(10)" .../>
    DTS> <fo:table-column column-width="proportional-column-width(30)" .../>
    DTS> <fo:table-column column-width="proportional-column-width(20)" .../>
    DTS> <fo:table-column column-width="proportional-column-width(30)" .../>

    DTS> <fo:table-body>
    DTS> <fo:table-row>
    DTS> <fo:table-cell padding="5px">
    DTS> <fo:block>Some stuff</fo:block>
    DTS> </fo:table-cell>
    DTS> </fo:table-row>
    DTS> </fo:table-body>

    DTS> </fo:table>

    DTS> This works as I expect: the contents of the block within the cell are surrounded by the requested padding.

    DTS> Now - For a variety of reasons, my XSLT transformation that generates this FO could be greatly simplified if could place the padding on the table cell's block element rather than on the table
    DTS> cell, as follows:

    DTS> <fo:table-cell>
    DTS> <fo:block padding="5px">Some stuff</fo:block>
    DTS> </fo:table-cell>

    DTS> When I do this, I do not see the expected padding. By placing a visible border around the block I've padded, it appears that the bounds of the block are being pushed beyond the bounds of the
    DTS> table cell. The end result is that the block's content rectangle is kept in the cell while the padding area and border are outside of the table cell.

    DTS> So, I have a few questions:

    DTS> 1) Why is this happening? Can someone please explain the basic algorithm being used here?

    DTS> 2) Is this the way things are supposed to work according to the spec, or is this a side affect of XEP's incomplete implementation of table column layout models?

    DTS> 3) Are there any workarounds I can consider that would allow me to pad the block(s) within a table cell directly rather then putting the padding attribute on the table cell FO element?

    DTS> Thanks,

    DTS> Tim Dean
    DTS> Principal Software Engineer
    DTS> Telephone: (651) 582-4791

    DTS> -------------------
    DTS> (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
    DTS> in the body of the message to majordomo@renderx.com from the address
    DTS> you are subscribed from.
    DTS> (*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html

    -------------------
    (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
    in the body of the message to majordomo@renderx.com from the address
    you are subscribed from.
    (*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html



    This archive was generated by hypermail 2.1.5 : Tue Aug 10 2004 - 01:41:18 PDT