【发布时间】:2022-04-27 15:40:48
【问题描述】:
我有一个带有内容和按钮的<td> 元素。内容的width 应该是除按钮宽度外的所有内容,该宽度将被固定。按钮应与内容的右侧对齐。我怎样才能做到这一点,以下不起作用:
<table border="1px">
<tr>
<td>
<div>
<div style="width: auto; overflow: auto;">
<span>
<form>
<textarea></textarea>
</form>
</span>
</div>
<div style="float: right; width: 32px;">
<button type="button" class="btn btn-primary">
Click
</button>
</div>
</div>
</td>
<td>Another cell</td>
</tr>
</table>
【问题讨论】:
-
这能回答你的问题吗? Align buttons in the td element to right
标签: html css html-table css-float