开发者

Is it possible to create a table within a <select> tag?

I'm looking to create a select statement where each opti开发者_高级运维on contains quantity and price for an item we're selling. I thought I would create a table where for every row, quantity would be in one , and price would be in the other . I can't seem to get this to work in a select statement. I also tried using tags with a float-right and float-left and this didn't work either. Anyone have any ideas?


You can't do this with plain vanilla HTML. You'll need to grasp Javascript to mimic such a dropdown with help of other HTML elements and a good shot of CSS. You can get here some ideas what's all possible with good JS (actually, jQuery) and CSS code.


One thing I've done with plain html is to just add the appropriate number of &nbsp; to line everything up correctly. JavaScript is probably the better way to go though.


You can't do this in plain HTML - you'd have to look at a javascript combo box replacement.


As an alternative to the above answers, you could just make the text of the options to make sense as english ..

something like

<select name="..">

<option value="1">1 item for xx price</option>
<option value="2">2 items for xxx price</option>
....
<option value="5">5 item for xxxx price</option>

</select>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜