0
\$\begingroup\$

I'm trying to make a table containing three labels in each row.

Something like this:

Label1 Label2 Label3

Text1 Text2 LongerText

LongTextLoremIpsum LongTextLoremIpsum LongTextLoremIpsum

Is there a way to fix the position of the labels so that they will be at the same position horizontally regardless of the length of the text in the label?

So far I'm using a table as the root container, and then HorizontalGroup for each row.

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

Have you tried using a table?

Table table = new Table();
// add items to first row
table.add(label1);
table.add(label2);
table.add(label3);
table.row(); // start next row
table.add(text1);
table.add(text2);
table.add(longerText);
table.row(); // last row
table.add(reallyLongText).colspan(3); //span last row over 3 columns
\$\endgroup\$

You must log in to answer this question.

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