two <select> always next to each other inseide <td>?
I have to selects inside td that's only one column in big table)and I want to make sure that they are next to each other at all times but td's width is width of these two selects. Not more.
The thing is that value to be displayed in selects changes based on data. So I thought I can assign fixed width 开发者_StackOverflow中文版to but not sure if there is some better solution to that.
If I resize the browser window it is ok. Maybe I need to change the properties?
<td>
<select name="db2.rfthdd">
<option value="WEI">WEI</option>
<option value="SCOTSdatabase">SCOTSdatabase</option>
</select>
<select id="db2.rfttimestamp">
<option value="20110302122831">2011-03-02-122831</option>
<option value="20110302122442">2011-03-02-122442</option>
</select>
</td>
You could assign a width to each select to ensure that they never grow wider than your td (but then text may get cut off and be hard to read) it's a bit of a trade of really.
Assign the width using css
select {width:100px;}
EDIT: now that i understand the question better, probably want to try setting the td not to wrap
<td style="white-space:nowrap;">
精彩评论