有什么方法可以对齐作为表格单元格子元素的 div 内的所有子元素。这是我的代码:
<td>
<div class="tablechild">310.2
<span class="subitem">01:10 PM</span>
</div>
</td>
采用
<td style="text-align:right">
<div class="tablechild">310.2<br/>
<span class="subitem">01:10 PM</span>
</div>
</td>
.tablechild {
position: relative;
}
.tablechild .subitem {
position: absolute;
display: inline-block;
right: 0;
width: 80px;
text-align: right;
}