How to right align elements in select

Y

yaweli

Hi,

In mozilla/firefox the right align work fine
In I.E not working.

<select style="text-align:right">
<option style="text-align:right">12,400</option>
<option style="text-align:right">48,450,000</option>
<option style="text-align:right">320</option>
</select>

(The Dir="RTL" is not a good solution.)

thank you
j.r
 
J

Jukka K. Korpela

In mozilla/firefox the right align work fine
In I.E not working.

<select style="text-align:right">
<option style="text-align:right">12,400</option>
<option style="text-align:right">48,450,000</option>
<option style="text-align:right">320</option>
</select>

There's no simple way around this IE limitation in its <select>
implementation, so it might be a good idea to use a set of radio buttons and
associated labels in a table instead. The labels (in this case, the numbers)
could then be right-aligned easily, even using just HTML. More info:
http://www.cs.tut.fi/~jkorpela/forms/choices.html#select-inflex
 
A

Andy Mabbett

Jukka K. said:
There's no simple way around this IE limitation in its <select>
implementation

What about a non-proportional font, and pre-prending the appropriate
number of non-breaking spaces?
 
J

Jukka K. Korpela

Andy Mabbett said:
What about a non-proportional font, and pre-prending the appropriate
number of non-breaking spaces?

I wouldn't call it a simple way, and it produces rather ugly appearance, and
it doesn't even make the elements right-aligned on IE. (For some odd reason,
IE leaves some space - corresponding to about two space characters - to the
right of the <option> contents if you try this trick.)
 

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

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top