我試圖使窗體看起來像下面的屏幕截圖一樣。文本框應該在文本之後立即開始,並且所有文本框都應該在同一點結束。使html表單中的所有文本框都在同一點結束
我現有的標記低於:
.txtbig {
width: 100%;
}
<table style="border: 1px solid black; border-image: none; width: 100%;">
<tbody>
<tr>
<td class="tableBody1" colspan="4">
<strong>Intended Recipient Information</strong>
</td>
</tr>
<tr>
<td>
Name and Title
</td>
<td colspan="2">
<input name="txtRecpNameTitle" class="txtbig" id="txtRecpNameTitle" type="text" maxlength="255">
</td>
<td style="width: 11px;">
<span id="RequiredFieldValidator23"><img tabindex="-1" alt="Error Icon" src="../images/errorIcon.png"></span>
</td>
</tr>
<tr>
<td>
Company Name and Division</td>
<td colspan="2">
<input name="txtRecpCompanyNameDiv" class="txtbig" id="txtRecpCompanyNameDiv" type="text" maxlength="255">
</td>
<td>
<span id="RequiredFieldValidator24"><img tabindex="-1" alt="Error Icon" src="../images/errorIcon.png"></span>
</td>
</tr>
<tr>
<td>
Complete Mailing Address</td>
<td colspan="2">
<input name="txtRecpCompleteMailAddress" class="txtbig" id="txtRecpCompleteMailAddress" type="text" maxlength="255">
</td>
<td>
<span id="RequiredFieldValidator25"><img tabindex="-1" alt="Error Icon" src="../images/errorIcon.png"></span>
</td>
</tr>
<tr>
<td>
Direct Telephone No.</td>
<td colspan="2">
<input name="txtRecpDirectTelNo" class="txtbig" id="txtRecpDirectTelNo" type="text" maxlength="255">
</td>
<td>
<span id="RequiredFieldValidator26"><img tabindex="-1" alt="Error Icon" src="../images/errorIcon.png"></span>
</td>
</tr>
<tr>
<td>
Email Address</td>
<td colspan="2">
<input name="txtRecpEmailAddress" class="txtbig" id="txtRecpEmailAddress" type="text" maxlength="255">
</td>
<td>
<span id="RequiredFieldValidator27"><img tabindex="-1" alt="Error Icon" src="../images/errorIcon.png"></span>
</td>
</tr>
<tr>
<td>
Intended Application</td>
<td colspan="2">
<input name="txtRecpIntendedApp" class="txtbig" id="txtRecpIntendedApp" type="text" maxlength="255">
</td>
<td>
<span id="RequiredFieldValidator28"><img tabindex="-1" alt="Error Icon" src="../images/errorIcon.png"></span>
</td>
</tr>
</tbody>
</table>
欣賞在同你的建議。
不可能做到你這樣做是在一個表的方式。表格列將自動調整到與最寬標籤相同的寬度。嘗試將它們放在一個表格元素中,並使用
您不應該將表格用於佈局,僅用於表格數據! –
table,tr,tr顯示可以被重置和flex用於第一次接近/測試。標籤和fieldset在這裏確實做得很好 –