Click to See Complete Forum and Search --> : display multiple values with option tag
cparsons
11-29-2004, 01:14 PM
I am working on a search engine that searches the company database for certain information such as name, phone, and location. I then create a dropdown list with the containing the values found. I am using a <SELECT MULTIPLE with option tags within. My goal is to have the persons name, phone, and location on the same line, within the OPTION tag with the first position of each field starting in the same column.
Currently I can display all three fields on the same line but the formatting looks terrible.
Is there a way to format the display values in an OPTION tag so that each field starts in the same position?
Thanks,
soccer362001
11-29-2004, 01:56 PM
I don't know if this will work or not, but try adding &# 32; to add extra spaces. P.S. make sure you take the space out of it.
cparsons
11-29-2004, 02:20 PM
Good try but it didn't make a difference.
thanks,
Ben Rogers
11-29-2004, 04:01 PM
Formatting form elements is always iffy, because it varies greatly depending on the browser, and markup isn't allowed nor acknowledged by the browser within the <option> element. I think that putting a space after the phrase, a vertical bar, and then another space before the next phrase makes them very usable.
However, if you really need them to have a tabular layout, then there's a usable (although not very attractive) solution: set the font-family as a monospace font (a la courier) and when the names are generated, determine the longest name, and add non-breaking spaces to the shorter names in order to make them reach the same length as the longest name, i.e.: <http://projep.no-ip.com:81/test/forum/formatted-selects.html> It's a sever design sacrifice, but I think for your situation, the enhanced usability makes it worth it.
cparsons
11-30-2004, 07:42 AM
Ben,
Thanks for your help. I am starting to see how it might start working. I am though, unable to get to that web site. Is it up?
I would like to see that example.
Thanks