Question: This is what my HTML looks like:

```
<select>
  <option>Long name <span>P1</span></option>
  <option>Peter <span>P2</span></option>
  <option>Hugo <span>K4</span></option>
</select>

```

I would like to display select options like this:

```html
Longname             P1
Petr                 P2
Hugo                 K4

```

codes (P1, P2, P4) aligned to the right side of select, conditions - I don't know length of longest name and I would prefer not to set exact width to any part of text

Answer: 
Option elements cannot have any child elements.. so what you're doing is not going to work. I recommend using <https://select2.github.io/> to replace your select box if you want more functionality.
```
<select>
  <option>
    <span style="float: left">Long name </span>
    <span style="float: right">P1</span>
  </option>
</select>

```