Skip to Content
avatar image
Former Member

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,


Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Jan 24, 2014 at 01:59 PM

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


    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; }



    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thank you.

      It's not the prefered solution, but I will find a workaround that works.

      I thought it was supported by the framework, in the meantime.