Reputation: 1322
I have added to my layout two labels:
Div container = new Div();
container.add(new Label(getTranslation(MessageConstants.SOME_DESCRIPTION)));
container.add(new Label(getTranslation(MessageConstants.MORE_DESCRIPTION_TEMPLATE, valueToAdd)));
add(container);
But this results in having no space between the labels. This looks bad, see image:
What is the best way to avoid this without combining both translation labels?
Upvotes: 0
Views: 305
Reputation: 1219
There are several ways to add a space between the two labels. But one way is to add some right padding to the first component like so:
Div container = new Div();
Label firstLabel = new Label("first");
firstLabel .getStyle().set("padding-right", "10px");
container.add(firstLabel);
container.add(new Label("second"));
Upvotes: 3
Reputation: 114
and should not -> please see Browser Inspector (padding, margins)
Upvotes: 0