是否可以将文本框和图像对齐在同一行中,使它们都占据单元格宽度的 100%? (没有像 width:95% 那样为文本框设置特定的宽度)
<table style="margin: 0px;float:left" border="1" width="50%" cellpadding="5" cellspacing="5">
<thead>
<tr>
<td class="title" colspan="2">
Options
</td>
</tr>
</thead>
<tbody>
<tr>
<td class="header" style="width: 110px;">
Date
</td>
<td>
<input name="txtRelease" type="text" id="txtRelease" style="float:left;display: block;width: 100%;height: 100%;" /><input type="image" name="ImageButton1" id="ImageButton1" style="float:left;" src="http://www.classiclodges.co.uk/images/icon_date_picker.jpg" style="border-width:0px;float:right" />
</td>
</tbody>
</table>
最佳答案
您可以将图像作为文本框的背景。在您的文本框 CSS 上试试这个。
background: url("http://www.classiclodges.co.uk/images/icon_date_picker.jpg") no-repeat scroll right center transparent;
关于html - 在表格单元格中对齐文本框和图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4724917/