# LibGDX: How to grow button height downwards in Table?

For my layout, I have a Table in which I add TextButtons with a height of 20. I also set the height of the table to 30. When I now increase the height of one button to 30, the height grows not downwards (filling the remaining height of the table). Instead, it grows upwards and overlaps other elements outside of the table.

I tried setting the alignment of the items to the top left but that didn't help.

table.align(Align.top | Align.left)


Further, I add the buttons like this:

table.add(button).height(20).expandX().fillX();


And to change the height of the buttons I use this code:

button.setHeight(30);


Is there some way to change this behaviour?

• .height seems to set all min, max and preferred heights to the same value. Have you tried changing those individually to allow the cell to grow?
– user35344
Jun 29 '21 at 15:08
• @Tyyppi_77 When I set minHeight to 20, max to 30 and instead of using button.setHeight(30) for the height change and using table.getCell(button).prefHeight(30) it seems to work. But it only updates the height when I resize the window instead of changing it right away. However, when I use button.setHeight It has the same behaviour as described in my question. Jun 29 '21 at 16:01