Link to home
Start Free TrialLog in
Avatar of kingasa
kingasa

asked on

Multi column selection list.

Hi

On a html page while using the <SELECT>,<OPTION> tags how can I display more then one column.

for example:
Description1 code1
Description2 code2
Description3 code3
.
.
.

I do not mind concating 2 strings "Description1 + code1" but it must look like they are on other columns, I mean each field should start exactly in the same place as the one above him.


    thanks
   
      Asa.
Avatar of Benja
Benja

I don't know if that's possible in HTML... However, with a dynamic language (PHP, ASP,...) you could manipulate the strings to have :

description | code
blabla      | 123
deeeesc     | 0
...
Oups... with the font in the message, the space is not the same. But in your <select>... you could have all the | at the same place.
The only way I know to do this, is to use a fixed font (like courier), and to insert non-breaking spaces to line 'em up right.

- Melle
Experts:

Cross-posted in JavaScript; and the user has a history mis-managing questions.  I recommend bypassing it here and keeping everything in the other one because the user is not likely to close out either one.

Cd&
>>I mean each field should start exactly in the same place as the one above him.

This isn't Access or Excel. You can set the fixed font, but there's no guarantee that the user will see what you expect. Adding a bunch of spaces doesn't mean that things will 'line up' -- it just means that there will be spaces -- maybe.

Use a delimiter between them. -- works, so does | ,  or **.
Or just use a different text to display than you use for the submitted value.
<select multiple="true" size="5">
...
ASKER CERTIFIED SOLUTION
Avatar of GwynforWeb
GwynforWeb
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
And again...
You can set the fixed font, but there's no guarantee that the user will see what you expect. Adding a bunch of spaces doesn't mean that things will 'line up' -- it just means that there will be spaces -- maybe.