function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SPruittSPruitt 

padding spaces in SelectOption label

Is there a technique for padding spaces in the label when creating SelectOption instances in a controller?  The multiple spaces I put in get trimmed to a single space.

Abhay AroraAbhay Arora

Try adding   in your string these spaces will not be truncated

SPruittSPruitt

  is the first thing I tried.  I ended up with literally   in the label.  I tried option.setEscapeItem(true);.  Same result.

GuyClairboisGuyClairbois

Hi there,

Did you ever find a solution? I'm struggling with the same..

Tnx,

Guy

SPruittSPruitt

Its long ago for me to remember the exact circumstances.  I looked at my application and the only thing close to this problem is I embed a space in the middle of

a SelectOption label.  Its straightforward, so I don't think its the same issue for my original post.

 

Is your problem padding spaces on the ends?  If so, I either did not find a solution and gave up; or my requirements changed and I no longer needed to do it.

 

Sorry, not much help.

GuyClairboisGuyClairbois

I embed multiple spaces in the middle of the label, so that I can line-up the last words in the labels. The spaces get trimmed back to 1 single space, though.

 

 

SPruittSPruitt

In that case, I can only assume I never found a solution.  I embed a single space.

I remember fighting for a long time and I tried everything I could think of.