HTML column with multiple columns

Is it possible to create a list box with a list of items in multiple columns? I know about alternatives, but I wonder if this is possible in<select>

+3
source share
2 answers

No, it is not. The only allowed child tag for selection is an option that itself can only contain plain text (but some browsers support some style tags here, for example, b or me, etc.).

+3
source

The only pseudo-solution I can think of is to use a fixed-width font for the drop-down list, and then fill the content columns with spaces.

 COL1_NAME         |  COL2_NAME
 Some nice value   |  Another value
 Another nice value|  Second column

"OPTGROUP" , , .

: , : http://twitpic.com/2lsuxx 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>
+1

Source: https://habr.com/ru/post/1763427/


All Articles