bootstrap-4 - 纯 bootstrap 4 单选按钮,其标签位于顶部,行与图例对齐
解决方案
您可以使用引导实用程序类轻松修改表以匹配所需的布局:
- https://getbootstrap.com/docs/4.6/utilities/borders/
- https://getbootstrap.com/docs/4.6/utilities/text/
- https://getbootstrap.com/docs/4.6/utilities/vertical-align/
- https://getbootstrap.com/docs/4.6/utilities/spacing/
只需覆盖即可完成以下操作border-color
:
tr.border-bottom {
border-color: black !important;
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
<div class="container">
<div class="row">
<div class="col">
<form>
<table class="table">
<tr class="text-center">
<td class="col">
<!-- makes this column grow -->
</td>
<th>header text</th>
<th>header text</th>
<th>header text</th>
<th>header text</th>
<th>header text</th>
</tr>
<tr class="text-center border-bottom">
<td class="text-left border-0 p-0">1. legend</td>
<td class="border-0 align-middle p-0"><input type="radio"></td>
<td class="border-0 align-middle p-0"><input type="radio"></td>
<td class="border-0 align-middle p-0"><input type="radio"></td>
<td class="border-0 align-middle p-0"><input type="radio"></td>
<td class="border-0 align-middle p-0"><input type="radio"></td>
</tr>
<tr class="text-center border-bottom">
<td class="text-left border-0 p-0">1. legend</td>
<td class="border-0 align-middle p-0"><input type="radio"></td>
<td class="border-0 align-middle p-0"><input type="radio"></td>
<td class="border-0 align-middle p-0"><input type="radio"></td>
<td class="border-0 align-middle p-0"><input type="radio"></td>
<td class="border-0 align-middle p-0"><input type="radio"></td>
</tr>
</table>
</form>
</div>
</div>
</div>
推荐阅读
- php - 在 Gmail 中收到任何邮件时在网络应用程序中显示通知
- gstreamer - 使用容器文件(MP4、MKV、...)添加文本覆盖
- ios - 在 OperationQueue 上运行 DataTask 时忽略 NSURLSession .waitsForConnectivity 标志
- python - 如何在pdf中插入.svg图片
- visual-studio - 如何查看使用不同项目设置重建项目的不同之处?
- scala - Spark Join 基于最近的日期
- django - 使用 django 和 firebase 进行电子邮件验证
- python - 作为 docker 容器托管的 Flask api 适用于 localhost:5000 但不适用于 172.17.0.2:5000
- python - 如何解码类似字符串的对象以提取主题?
- android - 从密钥库获取 Masterkey