【发布时间】:2021-09-12 14:26:31
【问题描述】:
您能帮我解决输入的对齐问题吗?我需要将它们放在最后两列(“Primary price”和“Secondary price”)上方,为了更好地理解,我添加了一个线框。
我在表格单元格中添加了引导列,但它破坏了整个表格,这是一个最小示例:
https://jsfiddle.net/ma7pv408/
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<div class="row">
<table class="table">
<thead class="thead-dark">
<tr>
<th class="col-1" scope="col">#</th>
<th class="col-3" scope="col">Name</th>
<th class="col-4" scope="col">Primary price</th>
<th class="col-4" scope="col">Secondary price</th>
</tr>
</thead>
<tbody>
<tr>
<th class="col-1" scope="row">1</th>
<td class="col-3">Mark</td>
<td class="col-4">9€</td>
<td class="col-4">100€</td>
</tr>
<tr>
<th class="col-1" scope="row">2</th>
<td class="col-3">Jacob</td>
<td class="col-4">23€</td>
<td class="col-4">208€</td>
</tr>
<tr>
<th class="col-1" scope="row">3</th>
<td class="col-3">Larry</td>
<td class="col-4">21€</td>
<td class="col-4">90€</td>
</tr>
</tbody>
</table>
</div>
【问题讨论】:
-
这些字段需要在表中有什么原因吗?表格通常应该只包含表格数据。
标签: html css bootstrap-4