urgent: Multicolumn select list

Discussion in 'HTML' started by Laxmi, Dec 31, 2003.

  1. Laxmi

    Laxmi Guest

    Hi,
    I have a select list, which looks like this:
    <select multiple size="8" name="SupervisorNames">
    <option value="ADAMO,CLAUDIA">ADAMO,CLAUDIA bd2sk9n</option>
    <option value="ABRAHAM,JEFFREY">ABRAHAM,JEFFREY
    g060812</option></optgroup>
    <option value="ACCELERATORS,IH">ACCELERATORS,IH b123456</option>
    </select>

    Each option in the list shows 2 things: a name and an ID. Since the
    names are of different lengths, its not possible to line up the IDs
    vertically. What I mean is, I would like the list to look like:

    <select multiple size="8" name="SupervisorNames">
    <option value="ADAMO,CLAUDIA">ADAMO,CLAUDIA bd2sk9n</option>
    <option value="ABRAHAM,JEFFREY">ABRAHAM,JEFFREY
    g060812</option></optgroup>
    <option value="ACCELERATORS,IH">ACCELERATORS,IH b123456</option>
    </select>

    I have tried getting the length of the longest name, then appending
    (max length - current name length) no. of spaces (i.e.:&nbsp;) to each
    name, to achieve this. But somehow it does not work, and the IDs do
    not line up vertically.
    I must have this information in a select list, so something like a
    table is not an alternative.
    Any help will be much appreciated.
     
    Laxmi, Dec 31, 2003
    #1
    1. Advertising

  2. Laxmi

    G. Doucet Guest

    I'm not a regular here, but since there was no reply yet...

    This is as close as I could get it, though I'm sure there must be a better
    way!

    I hope I understood what you meant.

    Guy Doucet


    <HTML>
    <HEAD>
    <STYLE TYPE='text/css'>
    BODY {font-family: Courier}
    SELECT {font-family: Courier}
    </STYLE>
    </HEAD>
    <BODY>
    Testing


    <select multiple size="8" name="SupervisorNames">
    <option value="ADAMO,CLAUDIA" >ADAMO........,CLAUDIA....bd2sk9n</option>
    <option value="ABRAHAM,JEFFREY">ABRAHAM......,JEFFREY....g060812</option>
    <option value="ACCELERATORS,IH">ACCELERATORS.,IH.........b123456</option>
    </select>

    </BODY>
    </HTML>
     
    G. Doucet, Dec 31, 2003
    #2
    1. Advertising

  3. Laxmi wrote:

    > I must have this information in a select list, so something like a
    > table is not an alternative.


    You could try setting a "font-family:monospace;" CSS rule on the select
    element (and the options within!) but this will only work some of the time.

    What's wrong with just putting the IDs in square brackets?

    <select multiple size="8" name="SupervisorNames">
    <option value="ADAMO,CLAUDIA">ADAMO,CLAUDIA [bd2sk9n]</option>
    <option value="ABRAHAM,JEFFREY">ABRAHAM,JEFFREY [g060812]</option>
    <option value="ACCELERATORS,IH">ACCELERATORS,IH [b123456]</option>
    </select>

    It's not quite what you wanted, but it should be clear enough for the
    users.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
     
    Toby A Inkster, Dec 31, 2003
    #3
  4. Laxmi

    G. Doucet Guest

    I just thought that if the ID numbers are all the same length, or if they
    can have leading zeros, you could display your select list with the ID
    numbers first. But perhaps that may not look quite as good.

    bd2sk9n ADAMO,CLAUDIA
    g060812 ABRAHAM,JEFFREY
    b123456 ACCELERATORS,IH


    Also, if the selected options will be submitted to a script you are writing,
    and you are only including the ID numbers in the select list for your script
    and not for the user, you could remove them from the list and have them as
    the values, if that will work...

    <option value="bd2sk9n">ADAMO,CLAUDIA</option>
    <option value="g060812">ABRAHAM,JEFFREY</option>
    <option value="b123456">ACCELERATORS,IH</option>

    I'll shut up now!
     
    G. Doucet, Dec 31, 2003
    #4
  5. Laxmi

    Laxmi Guest

    thanks everyone for the great suggestions. I'm sure I can use atleast
    one of them. Happy new Year.
    -Laxmi

    Toby A Inkster <> wrote in message news:<>...
    > Laxmi wrote:
    >
    > > I must have this information in a select list, so something like a
    > > table is not an alternative.

    >
    > You could try setting a "font-family:monospace;" CSS rule on the select
    > element (and the options within!) but this will only work some of the time.
    >
    > What's wrong with just putting the IDs in square brackets?
    >
    > <select multiple size="8" name="SupervisorNames">
    > <option value="ADAMO,CLAUDIA">ADAMO,CLAUDIA [bd2sk9n]</option>
    > <option value="ABRAHAM,JEFFREY">ABRAHAM,JEFFREY [g060812]</option>
    > <option value="ACCELERATORS,IH">ACCELERATORS,IH [b123456]</option>
    > </select>
    >
    > It's not quite what you wanted, but it should be clear enough for the
    > users.
     
    Laxmi, Jan 2, 2004
    #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. RockNRoll
    Replies:
    2
    Views:
    6,254
    Raterus
    Aug 4, 2004
  2. kackson
    Replies:
    4
    Views:
    2,905
    Eliyahu Goldin
    Nov 30, 2004
  3. Adam Clauss

    Multicolumn tree view control

    Adam Clauss, Apr 6, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    8,409
    belgaard
    Sep 23, 2006
  4. Replies:
    0
    Views:
    314
  5. devpoint
    Replies:
    0
    Views:
    259
    devpoint
    Oct 7, 2003
Loading...

Share This Page