How to right align elements in select

Discussion in 'HTML' started by yaweli@gmail.com, Jul 18, 2006.

  1. Guest

    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
     
    , Jul 18, 2006
    #1
    1. Advertising

  2. Jim Moe Guest

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

    An IE limitation.

    --
    jmm (hyphen) list (at) sohnen-moe (dot) com
    (Remove .AXSPAMGN for email)
     
    Jim Moe, Jul 18, 2006
    #2
    1. Advertising

  3. <> scripsit:

    > 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

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Jul 24, 2006
    #3
  4. Andy Mabbett Guest

    In message <7S3xg.24091$>, Jukka K.
    Korpela <> writes
    >> 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


    What about a non-proportional font, and pre-prending the appropriate
    number of non-breaking spaces?
    --
    Andy Mabbett
    Say "NO!" to compulsory ID Cards: <http://www.no2id.net/>

    Free Our Data: <http://www.freeourdata.org.uk>
     
    Andy Mabbett, Jul 24, 2006
    #4
  5. Andy Mabbett <> scripsit:

    >> 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?


    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.)

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Jul 24, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kay
    Replies:
    2
    Views:
    7,163
  2. tshad

    text-align vs align

    tshad, Jun 23, 2005, in forum: HTML
    Replies:
    1
    Views:
    1,266
    David Dorward
    Jun 23, 2005
  3. Paul Lautman

    left align within centre align

    Paul Lautman, Mar 3, 2006, in forum: HTML
    Replies:
    3
    Views:
    576
    Paul Lautman
    Mar 3, 2006
  4. Bogdan
    Replies:
    1
    Views:
    799
    Bogdan
    Jun 16, 2009
  5. Oran
    Replies:
    2
    Views:
    543
Loading...

Share This Page