Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Space between buttons (sap.m.Button) in HorizontalLayout

Hi there,

I have a sap.ui.layout.HorizontalLayout and inside (content) are some sap.m.Button controls. All these controls show up fine, but without padding/margin to each other, which leads to looooooong button with multiple words on it. At least it looks like so.

How do I define a padding/margin for the HorizontalLayout container, so every control inside gets a padding/margin automatically?

Thank you,

Tobias

Tags:
Former Member
Former Member replied

In the document it implies that spacing can't be controlled in the HorizontalLayout, so looks like you need to define in CSS.

HorizontalLayout

This example shows a simple HorizontalLayout.
Spacing between the items is currently not adjustable in the HorizontalLayout and has in this case been added with the following CSS:

#myTextField { margin: 0 4px; }  

https://sapui5.hana.ondemand.com/sdk/#test-resources/sap/ui/layout/demokit/HorizontalLayout.html

Regards,

Jason

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question