Tabs in a Select list?

Discussion in 'HTML' started by Martin, Apr 19, 2006.

  1. Martin

    Martin Guest

    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.
    Martin, Apr 19, 2006
    #1
    1. Advertising

  2. Martin

    Jim Moe Guest

    Martin wrote:
    > 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.

    --
    jmm (hyphen) list (at) sohnen-moe (dot) com
    (Remove .AXSPAMGN for email)
    Jim Moe, Apr 19, 2006
    #2
    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. qwweeeit
    Replies:
    2
    Views:
    636
    qwweeeit
    Dec 14, 2005
  2. rantingrick

    Tabs -vs- Spaces: Tabs should have won.

    rantingrick, Jul 16, 2011, in forum: Python
    Replies:
    95
    Views:
    1,796
    Roy Smith
    Jul 19, 2011
  3. John Kopanas
    Replies:
    2
    Views:
    266
    Gregory Brown
    Jan 29, 2007
  4. Pranjal Jain
    Replies:
    3
    Views:
    144
    saras
    Apr 10, 2008
  5. palmiere
    Replies:
    1
    Views:
    386
    Erwin Moller
    Feb 9, 2004
Loading...

Share This Page