【发布时间】:2021-02-20 06:22:35
【问题描述】:
我有一个包含 2 列的简单 Bootstrap 4 表 - 我希望能够将右上角列中的一些文本向右对齐,同时将该单元格中的剩余文本左对齐。
这是我的桌子:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<table class="table table-striped table-bordered">
<tr>
<td width=20%>SKU:</td>
<td width=80%>PM432523
<div class="text-right">On Special</div>
</td>
</tr>
<tr>
<td>Supplier:</td>
<td>Acme Meat Inc</td>
</tr>
</table>
我正在尝试使 On Special 字符串与 SKU 值右对齐并在同一行 - 我尝试过使用
and and 但似乎无法使其正常工作。我不确定这是否可能,或者是否有其他方法可以解决这个问题?
【问题讨论】:
标签: html css bootstrap-4