Remove space between Label and field

Certified Senior Developer

Hello All, 

I want to remove the space between the Label and field values (Screenshot below). Is there any way I can achieve that?

Please let me know if anyone knows how to do that. 

Thanks in advance.

  Discussion posts and replies are publicly visible

Parents Reply Children
  • Hi there,

    In relation of align of objects in the UI there is no right answer for it, and you achieve the look an feel that you are looking for in many different ways, you can play with the numbers of columns, width, use side by side, all this sort of things. If you are looking for a two columns more dense you can try side by side, it is not my favorite but you can get some ideas from the code below:

    a!localVariables(
      local!homeIn,
      local!mthsHomeIn,
      local!mogIn,
      local!mthsMorg,
      {
      a!columnsLayout(
        alignVertical: "MIDDLE",
        columns: {
          a!columnLayout(
            contents: {
       
              a!sideBySideLayout(
                alignVertical: "MIDDLE",
                items: {
                  
                  a!sideBySideItem(
                    item: a!richTextDisplayField(
                      align: "RIGHT",
                      labelPosition: "COLLAPSED",
                      value: {
                        a!richTextItem(
                          style: "STRONG",
                          text: "1. Homeowner's Insurance Premium"
                        )
                      }
                    )
                  ),
                  a!sideBySideItem(
                    item: a!integerField(
                      labelPosition: "COLLAPSED",
                      align: "RIGHT",
                      saveInto: local!homeIn,
                      value: local!homeIn,
                      refreshAfter: "UNFOCUS",
                      validations: {}
                    )
                  )
                }
              ),
              a!sideBySideLayout(
                alignVertical: "MIDDLE",
                items: {
    
                  a!sideBySideItem(
                    item: a!richTextDisplayField(
                      align: "RIGHT",
                      labelPosition: "COLLAPSED",
                      value: {
                        a!richTextItem(
                          style: "STRONG",
                          text: "2. Mortgage Insurance Premium"
                        )
                      }
                    )
                  ),
                  a!sideBySideItem(
                    item: a!integerField(
                      labelPosition: "COLLAPSED",
                      align: "RIGHT",
                      saveInto: local!mogIn,
                      value: local!mogIn,
                      refreshAfter: "UNFOCUS",
                      validations: {}
                    )
                  )
                }
              )
            }
          ),
          a!columnLayout(
            contents: {
              a!sideBySideLayout(
                alignVertical: "MIDDLE",
                items: {
                  a!sideBySideItem(
                    /*width: "1X",*/
                    item: a!richTextDisplayField(
                      align: "RIGHT",
                      labelPosition: "COLLAPSED",
                      value: {
                        a!richTextItem(
                          style: "STRONG",
                          text: "mnts"
                        )
                      }
                    )
                  ),
                  a!sideBySideItem(
                    width: "3X",
                    item: a!integerField(
                      labelPosition: "COLLAPSED",
                      align: "RIGHT",
                      value: local!mthsHomeIn,
                      saveInto: local!mthsHomeIn,
                      refreshAfter: "UNFOCUS",
                      validations: {}
                    )
                  ),
                  a!sideBySideItem(
                    width: "2X",
                  )
                }
              ),
              a!sideBySideLayout(
                alignVertical: "MIDDLE",
                items: {
                  a!sideBySideItem(
                    item: a!richTextDisplayField(
                      align: "RIGHT",
                      labelPosition: "COLLAPSED",
                      value: {
                        a!richTextItem(
                          style: "STRONG",
                          text: "mnts"
                        )
                      }
                    )
                  ),
                  a!sideBySideItem(
                    width: "3X",
                    item: a!integerField(
                      labelPosition: "COLLAPSED",
                      align: "RIGHT",
                      value: local!mthsMorg,
                      saveInto: local!mthsMorg,
                      refreshAfter: "UNFOCUS",
                      validations: {}
                    )
                  ),
                  a!sideBySideItem(
                    width: "2X",
                  )
                }
              ),
    
            }
          ),
          a!columnLayout(
            width: "EXTRA_NARROW"
          )
        }
      )
      }
    )
     

    Once again, there is many different to align your UI and is all about following the definitions of your project and try around different approaches.