Create a dropdown with 2 elements

Hey!
I would like to do someting like that with Select 2 (this screenshot come from Excel 2016)
aaaaaa
Here I would like to get a customer on the left, and his city on the left.
I did this :
while ($data = $client->fetch(PDO::FETCH_ASSOC)) {
echo “<option value=”{$data[‘client_id’]}">
{$data[‘client_societe’]} | {$data[‘client_ville’]}
";
}
But i would like to align the city on the right. Thank you!
Thank you!

You can provide a function to customize the display of items in the dropdown. Check the documentation here: https://select2.org/dropdown#templating.