Is it possible to create a List Box, with List Items in Multiple Columns? I am aware of the alternatives, but I am wondering if this is possible in <select>
views:
91answers:
2
+1
A:
No, it is not. The only allowed child-tag for select is option, which itself can only contain plain-text (but some browsers support some style-tags here, like b or i etc.).
heb
2010-09-06 10:19:56
A:
The only pseudo-solution I can think of is using a fixed-width font for the list dropdown and then padding the content columns with spaces.
COL1_NAME | COL2_NAME
Some nice value | Another value
Another nice value| Second column
You can even try using "OPTGROUP" elements for the column names, but you have to be aware of different formattings applied by different browsers.
Update: For instance you can create a "multi-column" dropdown as seen here: http://twitpic.com/2lsuxx with the following HTML
<style type="text/css">* {font-family:Courier New;white-space:pre;}</style>
<select>
<option></option>
<optgroup label=" Col1 | Col2">
<option>Some nice value | Another value</option>
<option>Another nice value| Second column</option>
<optgroup>
</select>
naivists
2010-09-06 10:20:25
@naivists, Fixed width Font.. Confused
Starx
2010-09-06 10:43:49
@Starx: something like Courier New. See example at: http://twitpic.com/2lsuxx
naivists
2010-09-06 11:20:50
@naivists, but these links are not separately clickable
Starx
2010-09-06 14:15:48
@Starx, no, of course not. You asked for a multi-column listbox without using any alternatives, and that's the best you can get. :-)
naivists
2010-09-06 16:19:40