I have a diagram as shown in the screenshot below. All of the green boxes are table layouts, so what we have here is a nested table layout structure. Now there is no fixed width for a table layout, so each box occupies as much width as determined by the number and size of its children. The first child of my outermost tableLayout box, labelled 1, resides in the first row’s first column, and determines the size for rest of the cells inside the container. Therefore, its siblings labelled 2, 3, 4 and 5, all residing on different rows inside cells whose widths are equal to the group labelled 1, are centred aligned and appear to have a lot of spacing around them, because their widths are much smaller than the cells that they occupy. Is there a way to left-align them inside their cells, as indicated by the red arrows?
Here is the template for my TableLayout:
const tableLayout = $(gojs.Group, "Vertical", new gojs.Binding("location", "loc", gojs.Point.parse).makeTwoWay(gojs.Point.stringify),
{
layout: $(TableLayout),
// margin: new gojs.Margin(4, 4),
// padding: new gojs.Margin(8, 4),
defaultAlignment: gojs.Spot.Left,
minSize: new gojs.Size(100,50)
},
new gojs.Binding("row", "row"),
new gojs.Binding('column', 'col'),
new gojs.Binding('columnSpan', 'colSpan'),
$(gojs.Panel, "Horizontal", // the header
{ defaultAlignment: gojs.Spot.Top, padding: new gojs.Margin(8, 4) },
$("SubGraphExpanderButton"), // this Panel acts as a Button
$(gojs.TextBlock, // group title near top, next to button
{ font: "Bold 12pt Sans-Serif", margin: new gojs.Margin(0, 4), maxSize: new gojs.Size(150,50) },
new gojs.Binding("text", "key", (data) => {
return `Table: ${data}`
})
),
),
$(gojs.Panel, "Auto",
$(gojs.Shape, "RoundedRectangle", { fill: null}),
$(gojs.Placeholder, {padding: 8,})
)
)