For my game's (mostly GUI based) UI i am using table from Scene2D in libGDX. I want independent column sizes in my table but first cell width is the width for all other rows in column. Is it possible to have a table in Scene2D with independent cell width in each row? For example, first cell in first row should have 10% width and first cell in second row should have 15% width. I tried using Horizontal Groups, Containers but they make my code too shabby and cluttered.enter image description here

  • \$\begingroup\$ Hey, did you find out how to do this? I'm kind of having the exact problem. \$\endgroup\$
    – Neerkoli
    Jul 1, 2016 at 8:24
  • 1
    \$\begingroup\$ i had to insert table within table. In whichever row you need different column size, insert a table of size 1 x N (N=no. of columns). I hope i am clear. \$\endgroup\$ Jul 2, 2016 at 4:20
  • \$\begingroup\$ pastebin.com/yBLDNvG2 \$\endgroup\$ Jul 2, 2016 at 4:30

1 Answer 1


There is an option to do this:

First of all you need to find out what your smallest size of a column is, therefore you have to merge all rows into one and pick the smallest width of all columns.

merging rows the numbers in the picture are displaying the width of the columns.

Knowing your smallest width (in my example it's displayed as 1) allows you to create a table with as many columns as you need. (for my example its 17 columns -> width / 17).

Now use:

table.add(Actor).colspan(#); //replace # with the amount of columns you want to span

In my example this would be:

Table t = new Table(skin);

output looks as follows: (note that I added a row with equally sized columns for reference above) output


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .