Horizontal layout with 2 button on the right

Hi, I am attempting to position 2button that I have in a footer Horizontal layout on the right.
The horizontal layout named footer is specified as:
footer.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR); footer.setWidth(100.0f, Unit.PERCENTAGE); footer.setSpacing(false);

Now I need the 2 button on the right but one button is on the right, the other in the middle (bottom). I see in the developer tools that there’s a v-slot for each button with width 50% (I think because the footer is 100%). What’s the correct way to solve that problem, maybe with a little space between the 2 buttons.


HorizontalLayout hLayout = new HorizontalLayout();

using this, you don’t even have to give the buttons any width so they are just as wide as they need to be for their text.
Of course, you can still define their widths yourself. Just remember that if all your buttons have a 100% width themselves, the whole HorizontalLayout does not have extra space to justify anything.
Another thing to notice is that there can be issues if your layout has spacing set to true, but you don’t have that.

See more about justify-content property for flex [here]