|
Rank: Newbie
Joined: 5/31/2018 Posts: 5
|
Is there any way to set single cell width in a dynamic table nested into another dynamic table? I tried linking width of cell to 'cell-width' with xpah but it never worked... Should i convert attribute value in some way?
Example xsd:
Code:<xs:complexType name="my_table_type_2"> <xs:sequence> <xs:element name="single_row" type="multi_line_row" maxOccurs="unbounded" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType name="multi_line_row"> <xs:sequence> <xs:element name="single_cell" type="multi_line_cell" maxOccurs="unbounded" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType name="multi_line_cell"> <xs:sequence> <xs:element name="single_line" type="xs:string" maxOccurs="unbounded" minOccurs="0"/> </xs:sequence> <xs:attribute name="font-weight" type="xs:string" use="optional" default=""/> <xs:attribute name="cell-width" type="xs:string" use="optional"/> </xs:complexType>
Example xml:
Code:<my_table_2> <single_row> <single_cell font-weight="bold" cell-width="100px"> <single_line></single_line> <single_line></single_line> <single_line>TEST N°</single_line> </single_cell> <single_cell cell-width="100px"> <single_line>Specimens</single_line> <single_line>dia. [mm]</single_line> <single_line></single_line> </single_cell> </single_row> <single_row> <single_cell cell-width="100px"> <single_line></single_line> <single_line>TTQ+TDS-320447-1 (3)</single_line> <single_line></single_line> </single_cell> <single_cell cell-width="100px"> <single_line></single_line> <single_line>12,50</single_line> <single_line></single_line> </single_cell> </single_row> </my_table_2>
Example design in attachments!
Any answer is welcome! :-)File Attachment(s): prova_hb.xsd (2kb) downloaded 220 time(s). prova_hb.xml (4kb) downloaded 215 time(s). prova_hb.sps (7kb) downloaded 211 time(s).
emalot attached the following image(s):
|
|
Rank: Advanced Member
Joined: 2/27/2009 Posts: 565
|
Please return to your original post and attach your actual files as that makes it easier to help you.
|
|
Rank: Newbie
Joined: 5/31/2018 Posts: 5
|
I did it. Hope this will help :-)
|
|
Rank: Advanced Member
Joined: 2/27/2009 Posts: 565
|
Quote:I tried linking width of cell to 'cell-width' with xpah but it never worked.
It looks like it works to me. Some of your single_cell elements have a cell-width attribute value of '100px' and, indeed, when we preview output those cells appear to be 100px wide.
The only problem I see is that your single_cell elements whose cell-width attribute has a percentage width such as 25% don't cause the inner table to expand wider than necessary, but that's because the relative percentage width has no parent container to base the width on.
That is, the inner table itself has no intrinsic width. You can apply one in case the cell-widths are relative using an XPath expression for the inner table such as the following.
Code:if ( contains( single_cell[1]/@cell-width, '%' ) ) then '100%' else ''
You can replace the 100% with whatever you want.File Attachment(s): prova_hb.new.pxf (119kb) downloaded 239 time(s).
|
|
Rank: Newbie
Joined: 5/31/2018 Posts: 5
|
Sorry, this is not working for me... I forgot to say that I need to transform to Word2007+ format
|
|
guest |