How to add extra spaces in a text field for better display?

I want more than one space to be inserted between two words in a text field. 

I have used below code, but it is not working.

a!textField(
label: "Approved: 5"& "                 Closed: 7",
readOnly: true()
)

I want to display the content in this way. Is there any way to do it.  

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Lead Developer
    in reply to vinayakp

    joinarray(repeat(times: _, input: char(160)))

    This code snippet generates as many U+00A0 (which is char 160) as you need.  Just replace the underscore with whatever number of spaces you require, then concat this between the values you want to put spaces between.  Repeat generates a list, and joinArray gets rid of the ugly semicolons.

    value: "This text followed by spaces" & joinarray(repeat(times: 12, input: char(160))) & "before this text",

    OR

    value: concat( 

    "This text followed by spaces",

    joinarray(repeat(times: 12, input: char(160))),

    "before this text"

    ),

    One especially great thing about this is that it allows you to set up the spacing as a constant, so you can easily keep spacing consistent across the entire application, if you want to.