In a drop down list, I need to add spaces in front of the options in the list. I am trying
<select>
<option>  Sample</option>
</select>
for adding two spaces but it displays no spaces. How can I add spaces before option texts?
In a drop down list, I need to add spaces in front of the options in the list. I am trying
<select>
<option>  Sample</option>
</select>
for adding two spaces but it displays no spaces. How can I add spaces before option texts?
I'm nearly certain you can accomplish this with CSS padding, as well. Then you won't be married to the space characters being hard-coded into all of your
<option>
tags.I think you want
or 
So a fixed version of your example could be...
or
Use \xA0 with String. This Works Perfect while binding C# Model Data to a Dropdown...
You can also press alt+space (on mac) for a non-breaking space. I use it for a Drupal module because Drupal decodes html entities.
1.Items Return to List
2.Foreach loop in list
3..
This work for me!!!
Isn't
 
the entity for space?Works for me...
EDIT:
Just checked this out, there may be compatibility issues with this in older browsers, but all seems to work fine for me here. Just thought I should let you know as you may want to replace with