Expand my Community achievements bar.

SOLVED

Table inside table must grow together

Avatar

Level 1

Hello

I have a table inside a table. I need that the second table (in Red) expands together with the first cell of the blue table.

pmcastro_2-1590417437591.png

In blue the first table with 2 columns

In red the other table inside cell 2 of the first table

How can I do this?

 

Tkanks for your help.

Regards

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi, 

 

you can use a script to "synchronize" the heights of the inner and outer table. 

Aussumed you have the following hierarchy.

radzmar_0-1590566994757.png

 

Put this script into the layout:ready event of the row "NestedRow" of the nested table.

var cUnit = "mm",
	nRefH = xfa.layout.h(Table.Row, cUnit),
	nThisH = xfa.layout.h(this, cUnit);
	
NestedCell1.minH = nRefH > nThisH === true ? nRefH.toString().concat(cUnit) : "5mm"; // replace 5mm with a minimum height of your choice.
xfa.layout.relayout();

 

The script will compare the height of the row that contains nested table with the row of the nested table itself and will change the minimum height of the first cell of the nested table. All other cells of it will then automatically use the same height.

 

 

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi, 

 

you can use a script to "synchronize" the heights of the inner and outer table. 

Aussumed you have the following hierarchy.

radzmar_0-1590566994757.png

 

Put this script into the layout:ready event of the row "NestedRow" of the nested table.

var cUnit = "mm",
	nRefH = xfa.layout.h(Table.Row, cUnit),
	nThisH = xfa.layout.h(this, cUnit);
	
NestedCell1.minH = nRefH > nThisH === true ? nRefH.toString().concat(cUnit) : "5mm"; // replace 5mm with a minimum height of your choice.
xfa.layout.relayout();

 

The script will compare the height of the row that contains nested table with the row of the nested table itself and will change the minimum height of the first cell of the nested table. All other cells of it will then automatically use the same height.

 

 

Avatar

Level 1
So many thanks radzmar. It works perfectly!!!