Table Panel inside Group

I want to create a group and add nodes and others groups to it but child nodes and groups need to be in different row and column position so that if a insert more than one elements in one table location, other locations change their width and height accordingly.
what i coded so far is :

             diagram.groupTemplate =                    
                $(go.Group, 'Spot',
                  new go.Binding('row', 'row'),
                  new go.Binding('column', 'column'),
                  $(go.Panel, 'Auto',
                    $(go.Shape, 'Rectangle',
                      new go.Binding('fill', 'fill'),
                      new go.Binding('stroke', 'stroke')),
                    $(go.Panel, 'Table',
                        {padding: 30})
                    { alignment: new go.Spot(0.98, 0.02), alignmentFocus: go.Spot.TopRight,
                     font: 'bold 10pt sans-serif'},
                    new go.Binding('text', 'text'))
            diagram.nodeTemplate =
                $(go.Node, 'Spot',
                  $(go.Shape, 'Rectangle', { fill: 'lightgray' }),
                    { alignment: new go.Spot(0.95, 0.05), alignmentFocus: go.Spot.TopRight,
                     font: 'bold 10pt sans-serif'},
                    new go.Binding('text', 'key'))
            diagram.linkTemplate =
                  { routing: go.Link.AvoidsNodes,curve: go.Link.JumpOver},
            diagram.model =
                  { linkFromPortIdProperty: 'fromPort',
                   linkToPortIdProperty: 'toPort',
                   nodeDataArray: [{"key":"wb_env","isGroup":true,"fill":"#bbb","text":"wb_env"},
                                   {"key":"wb_env_left_top","group":"wb_env","isGroup":true,"fill":null,"text":"","stroke":"green","row": 0,"column":0},

and it gives me out put something like this:

but what i want is :

Any idea how i can achieve this ?

You’ll need to define your own Diagram.layout to size and position the groups in the manner that you want.

The SwimLanes sample,, has a custom Layout called StackLayout that does this in one dimension. That layout makes sure all of the top-level Groups have the same width (even if they are empty) that is wide enough to hold whatever is in the group, and it arranges them vertically next to each other. It appears that you want to do something like that but in two dimensions.

The SwimLanes sample also has custom resizing abilities for groups, but you might not need any of that stuff.