0

I have a group of option tags inside an HTML select tag. Each option displays an ID and a name. I want to align the names altogether. Here is my HTML code:

<select size="3">
  <option value='100'>100&nbsp;&nbsp;&nbsp;John Doe</option>
  <option value='200'>200&nbsp;&nbsp;&nbsp;Jane Doe</option>
  <option value='1001'>1001&nbsp;&nbsp;&nbsp;Jim Doe</option>
  <!--there is an extra digit; the name is bumped over 1 char to the right-->
</select>

Here is the display I want:

100   John Doe
200   Jane Doe
1001  Jim Doe
Smollet777
  • 1,618
  • 1
  • 16
  • 15
Jaime Dolor jr.
  • 897
  • 1
  • 11
  • 28
  • 1
    You can't not using a standard select. Your going to need to use a javascript plugin of some description – Liam Nov 21 '18 at 10:05
  • if you use jquery, this is a good plugin: https://select2.org/ – Pete Nov 21 '18 at 10:08

0 Answers0