我想td
在表格的左侧放置一个元素并使其跨越多行。在该td
元素的右侧,我想对齐原始元素跨越td
的每一行中的多个元素。td
然而,由于我不擅长 HTML/CSS,我最近的尝试看起来像这样。
我想要的是标签和输入文本框位于标签/输入Territory
下方。Effective on this date
(用我的艺术/绘画才能突出我希望领土的东西去的区域)
HTML/剃刀
<table class="boxMe">
<tr>
<td id="zipBox">
@Html.Raw("Zip Code")
@Html.TextAreaFor(model => model.searchZip, new { style = "width: 300px;", placeholder = "Enter up to 35 comma separated zip codes" })
</td>
<td id="dateBox">
@Html.LabelFor(model => model.searchDate)
@Html.TextBoxFor(model => model.searchDate, new { style="width: 80px;"})
</td>
<td id="stateBox">
@Html.LabelFor(model => model.searchState)
@Html.DropDownListFor(model => model.searchState, Model.StateCodes, " ")
<button type="submit" id="SearchButton">Search</button>
</td>
</tr>
<tr>
<td id="terrSearch">
@Html.LabelFor(model => model.searchTerritory)
@Html.TextBoxFor(model => model.searchTerritory, new { style = "width: 30px;padding-left:10px;", maxLength = 3 })
</td>
</tr>
</table
CSS
#zipBox {
float: left;
padding-left: 20px;
padding-right: 10px;
padding-top: 20px;
padding-bottom: 20px;
vertical-align: top;
row-span: 2;
border:none;
}
#dateBox {
float: left;
padding-right: 10px;
padding-top: 20px;
border:none;
}
#stateBox {
float: left;
padding-right: 20px;
padding-top: 20px;
border:none;
}
#terrSearch {
border:none;
}
.boxMe
{
float: left;
border: 1px solid Silver;
padding: 3px;
}