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\$
0
\$\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
| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.