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
MRG73MRG73 

Problem adding whitespace to selectOption

I have a controller extension that I'm using to populate a selectList.  I have two categories of information that I'd like users to be able to select from so I'm trying to create an indented type of look on the SelectList:

 

Type 1

Select 1

Select 2

Type 2

Select 1

Select 2

 

I can't seem to find a way to get any blank space to be maintained on the VF page I've tried among other things setting the style on the selectlist to style="white-space:pre;" and embedding non-breaking space in my selectoption string but that doesn't work - Options.add(new SelectOption(1, '  Select 1'));

 

Any Suggestions? 

MRG73MRG73

meant to show Select 1, Select 2 etc. indented.

Shebin-KVP Business SolnsShebin-KVP Business Solns

Hi

 

 Please use the string        &nbsp  infront of each of your  Select 1,Select 2  browser will understand as space.

Shebin-KVP Business SolnsShebin-KVP Business Solns

Try with more ' '

MRG73MRG73

This is within APEX code not in the browser.  The '&nbsp just shows up in the string it does not create any white space.