Wrapping text within table row

View: New views
2 Messages — Rating Filter:   Alert me  

Wrapping text within table row

by el1986 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm trying to display line items of an order/invoice, it all works fine if the line items description isn't too long. However when it becomes too long the description wraps which is what i want to happen but it seems to move onto the whole descripion onto the next row.
So the first row contains the details of the 1st line item (with a blank cell where the description should be), the 2nd line contains the description in the correct column, the 3rd colum contains the details of the 2nd line item (with a blank cell where the description should be), the 4th line contains the description of the 2nd line item. So something like this:

Line No     Description     Value
1                                    10
               wrapped
               description
2                                    20
               wrapped
               description2


So i want the description to start on the same row as the rest of the line item details.
This is what i have for the cell.

<fo:table-cell border-style="none" border-width="2pt" background-repeat="repeat" display-align="start">
      <fo:block>
            <fo:block>
                    <xsl:value-of select="def:LineItem/def:Item/def:Description"/>
            </fo:block>
       </fo:block>
</fo:table-cell>

I'm not experienced in xsl-fo at all, so any help would be appreciated.
Thanks in Advance

Re: Wrapping text within table row

by Tony Graham-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Mon, Jul 14 2008 15:56:54 +0100, elin.lloyd@... wrote:
> I'm trying to display line items of an order/invoice, it all works fine if
> the line items description isn't too long. However when it becomes too long
> the description wraps which is what i want to happen but it seems to move
> onto the whole descripion onto the next row.
> So the first row contains the details of the 1st line item (with a blank
> cell where the description should be), the 2nd line contains the description
> in the correct column, the 3rd colum contains the details of the 2nd line
> item (with a blank cell where the description should be), the 4th line
> contains the description of the 2nd line item. So something like this:

If you showed the borders of the cells -- e.g., if you added
border="solid black thin" or border-style="solid" -- then you'd see
whether you had blank cells or a block with space before it.

It might also make things clearer if, for the sake of seeing what's
what, you gave a different background-color value to the block within
the table-cell.

...

> So i want the description to start on the same row as the rest of the line
> item details.
> This is what i have for the cell.
>
> <fo:table-cell border-style="none" border-width="2pt"
> background-repeat="repeat" display-align="start">
>       <fo:block>
>             <fo:block>
>                     <xsl:value-of
> select="def:LineItem/def:Item/def:Description"/>
>             </fo:block>
>        </fo:block>
> </fo:table-cell>

I don't know why you'd need two nested fo:block.  One should be sufficient.

We can't tell anything about your XPath because you didn't provide a
sample of your input XML.

It might also help if you showed the complete FO markup for a one-row
invoice table.

> I'm not experienced in xsl-fo at all, so any help would be appreciated.

It might help you if you do the transform to the FO vocabulary using an
XSLT processor then play around with that file and run that through your
XSL formatter to see if you can see what's causing the problem, and then
modify your XSLT so it produces the correct FO markup once you know what
the correct markup is.

Regards,


Tony Graham                         Tony.Graham@...
Director                                  W3C XSL FO SG Invited Expert
Menteith Consulting Ltd
XML, XSL and XSLT consulting, programming and training
Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
Registered in Ireland - No. 428599   http://www.menteithconsulting.com
  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
xmlroff XSL Formatter                               http://xmlroff.org
xslide Emacs mode                  http://www.menteith.com/wiki/xslide
Unicode: A Primer                               urn:isbn:0-7645-4625-2

LightInTheBox - Buy quality products at wholesale price!