Tabs in a Select list?

M

Martin

Is there any way I can get a drop-down list in a Select tag to display
it's contents in two columns? Say, for example, I wanted to display a
list of people's names with the last name aligned to the left side and
the first name aligned to the center.

Maybe a tab character between them?

I've tried a couple of things but I can't get anything to work.
 
J

Jim Moe

Martin said:
Is there any way I can get a drop-down list in a Select tag to display
it's contents in two columns? Say, for example, I wanted to display a
list of people's names with the last name aligned to the left side and
the first name aligned to the center.
select, option {
white-space: pre;
font-family: monospace;
}
The whitespace in the <select> is still collapsed but at least the
<option>s align like you would like. The backend processor decides how
many spaces to put in the list to get it to look columnar.
The font has to be monospace, else the spacing does not work like you
expect.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top