[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: problem with table

Subject: RE: problem with table
From: Eldho George <georgee@xxxxxxxxxxx>
Date: Mon, 20 Sep 2004 16:29:03 +0530
eldho
Thanks ken.Thank you very much for your nice reply
It tried your code snippet and it worked fine

Cheers
George
-----Original Message-----
From: G. Ken Holman [mailto:gkholman@xxxxxxxxxxxxxxxxxxxx] 
Sent: Monday, September 20, 2004 4:14 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  problem with table

At 2004-09-20 15:21 +0530, Eldho George wrote:
>I have some problem with <fo:table-column>.Suppose i am using different
>table structure such as
>first <tr> contains 3 <td>.Second <tr> contains 4 <td>.Then 3<tr> onwards
it
>contains 6 <td>
>The following is my table template.
><xsl:for-each select="tr/th|tr/td|thead/tr/th|thead/tr/td">
>         <fo:table-column/>
></xsl:for-each>

This would obtain *every* th and *every* td and give you one table column 
per item, which is why you are getting so many columns.

Remember that all rows in an XSL-FO table will render with the same number 
of columns and the column edges will be the same for all rows in a single 
table.

Thus, you need only traverse the maximum number of columns.  The maximum 
number of columns can be obtained by sorting the rows by the number of 
columns, sorting them in descending order, and acting on the first of those:

       <xsl:for-each select="tr|thead/tr">
         <xsl:sort select="count(td|th)" data-type="number"
                   order="descending"/>
         <xsl:if test="position()=1">
           <xsl:for-each select="td|th">
             <table-column/>
           </xsl:for-each>
         </xsl:if>
       </xsl:for-each>

I hope this helps.

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




--
World-wide on-site corporate, govt. & user group XML/XSL training.
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.