Wrap table column content

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guru

    #1

    Wrap table column content

    Hi,

    I am using FOP for creating pdf.
    I am having a table which has 14 columns.
    And each column contents may contain any
    number of chars.

    My problem is :
    When the text is having no spaces in between like
    "thisisalongwor dandcouldnotbew rapped", it is overlapping
    another column. How to wrap the text with in the cell.??

    I used wrap-option="wrap" overflow="auto" , but no luck.
    Is there any solutions for this?

    Guru.
  • Guru

    #2
    Re: Wrap table column content

    Finally i solved the problem
    by inserting zero width white spaces at regular intervals.
    Thanks to FOP mailing list..!


    <xsl:call-template name="text_wrap per"> <xsl:with-param
    name="Text" select="$myStri ng"/>
    </xsl:call-template>


    ===Templates used to do the task.
    <xsl:template name="text_wrap per">
    <xsl:param name="Text"/>
    <xsl:choose>
    <xsl:when test="string-length($Text)">
    <xsl:value-of select="substri ng($Text,1,25)"/>
    ​
    <xsl:call-template name="wrapper_h elper">
    <xsl:with-param name="Text" select="substri ng($Text,26)"/>
    </xsl:call-template>
    </xsl:when>
    </xsl:choose>
    </xsl:template>
    <xsl:template name="wrapper_h elper">
    <xsl:param name="Text"/>
    <xsl:value-of select="substri ng($Text,1,25)"/>
    ​
    <xsl:call-template name="text_wrap per">
    <xsl:with-param name="Text" select="substri ng($Text,26)"/>
    </xsl:call-template>
    </xsl:template>


    rampaadh@yahoo. com (Guru) wrote in message news:<ab9532c9. 0409300001.66ec b5d4@posting.go ogle.com>...[color=blue]
    > Hi,
    >
    > I am using FOP for creating pdf.
    > I am having a table which has 14 columns.
    > And each column contents may contain any
    > number of chars.
    >
    > My problem is :
    > When the text is having no spaces in between like
    > "thisisalongwor dandcouldnotbew rapped", it is overlapping
    > another column. How to wrap the text with in the cell.??
    >
    > I used wrap-option="wrap" overflow="auto" , but no luck.
    > Is there any solutions for this?
    >
    > Guru.[/color]

    Comment

    Working...