1
\$\begingroup\$

I have a libgdx table that initially looks like this...

enter image description here

And I'd like the last cell to expand so that the logical bounds fill the widget bounds. As soon as I set the last cell to expandX it looks like this..

enter image description here

The widget bounds are correct, but now the logical bounds have gone beyond it. Why is the table suddenly doing this? The only difference in the code between the two is the expanding of the last cell...

contentTable
   .add(new Label("Abc",ui.getUiSkin(), UiSkin.Label.detailH3))
   .expandX() //this is removed in the first screenshot
 ;

Edit: It looks like this is related to using colspan, though I still dont understand why. In the screenshots above, the middle cell on both rows is set to colspan(2). If I remove that setting the table expands correctly. I have no clue why setting colspan would break the table in that way, but I'll leave this question open because I actually do need to use the colspan setting there.

\$\endgroup\$
1
  • \$\begingroup\$ Can you show the code for a Minimal Complete Verifiable Example? \$\endgroup\$
    – DMGregory
    Jul 11, 2022 at 11:21

0

You must log in to answer this question.

Browse other questions tagged .