【发布时间】:2016-04-01 18:44:11
【问题描述】:
我一直在尝试让选择下拉菜单与表格行中的输入框保持在同一行,但输入框一直转到下一行。我试图用display:inline-block 将它们都包装在一个div 中,但它不起作用。
<table>
<tr>
<td>
<div style="display:inline-block">
<select id="ajaxtypes">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
</select>
<input type="text" name="type" style="width:100%; background-color:#fff000">
</div>
</td>
<td>
<input type="text" name="type" style="width:100%; background-color:#fff000">
</td>
<td>
<input type="text" name="type" style="width:100%; background-color:#fff000">
</td>
<td>
<input type="text" name="type" style="width:100%; background-color:#fff000">
</td>
</tr>
</table>
如果能得到任何帮助,我将不胜感激。
这是JSFiddle
【问题讨论】: