我知道我在使用表格时错了,但这似乎是最可行的选择。
我正在尝试对齐表单中的文本和下拉菜单。问题是文本可以是单行或双行,当我想让它们在同一行中保持相同时,很难给它一个相对高度。
当我为单行添加填充以实现完美对齐时,带有两行文本的文本会破坏它。我可以做一些适用于一条线和两条线的相对操作吗?
HTML
<table>
<tbody>
<tr>
<td style="width: 120px;" class="level-heading">
<div style="position: absolute;">Client Name</div>
</td>
<td style="width: 120px">
<div class="level">
<select name="ctl00$MainContent$cmbClientName" id="MainContent_cmbClientName" style="width:140px;">
<option selected="selected" value="Select One">Select One</option>
</select>
</div>
</td>
<td style="width: 120px;" class="level-heading">
<div style="position: absolute;">Business Segment</div>
</td>
<td style="width: 120px">
<div class="level">
<select name="ctl00$MainContent$cmbBusinessSegment" id="MainContent_cmbBusinessSegment" style="width:140px;">
<option selected="selected" value="Select One">Select One</option>
</select>
</div>
</td>
<td style="width: 120px;" class="level-heading">Business Segment Category
</td>
<td style="width: 130px">
<div class="level">
<select name="ctl00$MainContent$cmbBusinessSubGroup" id="MainContent_cmbBusinessSubGroup" class="level-big" style="width:180px;">
<option selected="selected" value="Select One">Select One</option>
</select>
</div>
</td>
</tr>
<tr>
<td style="width: 120px;" class="level-heading">Experience Test From
</td>
<td style="width: 120px">
<div class="level">
<select name="ctl00$MainContent$cmbFrom" id="MainContent_cmbFrom" style="height:16px;width:140px;">
<option selected="selected" value="Select One">Select One</option>
</select>
</div>
</td>
<td style="width: 120px;" class="level-heading">Experience Test To
</td>
<td style="width: 120px" align="justify">
<div class="level">
<select name="ctl00$MainContent$cmbTo" id="MainContent_cmbTo" style="width:140px;">
<option selected="selected" value="Select One">Select One</option>
</select>
</div>
</td>
<td style="width: 120px">
<span id="MainContent_lblPeriodTo"></span>
</td>
<td style="width: 130px"></td>
</tr>
<tr>
<td colspan="6" style="height: 10px"></td>
</tr>
</tbody>
</table>
CSS
这是与上述问题相关的 CSS。
.level-heading {
font-size: 12px;
padding-bottom: 12px;
}
.decision-page select {
font-size: 12px;
}
.fullpage-width {
width: 896px;
}