Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The <a href="http://www.w3.org/TR/html401/interact/forms.html#h-17.6" rel="nofollow noreferrer"><code>option</code> element</a> content is taken as plain text (no tags are recognized), so there is no direct way to do it. As a clumsy workaround, you can hand-format the options using a monospace font and use no-break spaces:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;style&gt; select, option { font-family: Consolas, monospace; } &lt;/style&gt; &lt;select&gt; &lt;option&gt;option 1 0.5 &lt;option&gt;option 2 1.5 &lt;option&gt;one more option 110.5 &lt;/select&gt;</code></pre> </div> </div> </p> <p>(where the spaces inside the <code>option</code> elements are no-break spaces; use <code>&amp;nbsp;</code> for them if you don’t know how to type no-break spaces in your authoring environment).</p> <p>A completely different workaround, or approach, is the replace the <code>select</code> element by a set of checkboxes (or, depending on desired logic, radio buttons) and associated labels. You can then represent this data in a table and set suitable formatting on it:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;table&gt; &lt;tr&gt;&lt;td&gt;&lt;input type=checkbox&gt; &lt;td&gt;option 1 &lt;td align=right&gt;0.5 &lt;tr&gt;&lt;td&gt;&lt;input type=checkbox&gt; &lt;td&gt;option 2&lt;td align=right&gt;1.5 &lt;tr&gt;&lt;td&gt;&lt;input type=checkbox&gt; &lt;td&gt;one more option &lt;td align=right&gt;110.5 &lt;/table&gt;</code></pre> </div> </div> </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload