urgent: Multicolumn select list

L

Laxmi

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

G. Doucet

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

Toby A Inkster

Laxmi said:
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.
 
G

G. Doucet

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!
 
L

Laxmi

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

Toby A Inkster said:
Laxmi said:
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.
 

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
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top