html - 在引导表右侧创建垂直边框
问题描述
我正在尝试在<th>
引导表之间插入一个短的右边框,但是我无法获得所需的结果。谁能帮我?
我的代码:
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">First</th>
<th scope="col">Last</th>
<th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td>Larry</td>
<td>the Bird</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
</div>
CSS:
.table thead th {
vertical-align: bottom;
border-bottom: 2px solid #dee2e6;
border-right: 2px solid black;
}
解决方案
尝试这个
.table thead th {
vertical-align: bottom;
}.table thead th span{float:right;color:#000;}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"> <table class="table">
<thead>
<tr >
<th scope="col">#<span> | </span></th>
<th scope="col">First<span> | </span></th>
<th scope="col">Last<span> | </span></th>
<th scope="col">Handle<span> | </span></th>
</tr>
</thead>
<tbody>
<tr >
<th scope="row">1</th>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td>Larry</td>
<td>the Bird</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
推荐阅读
- javascript - 机器人检查成员是否具有角色
- json - 将 JSON 与数组合并以创建新文件
- bash - 如何根据 bash shell 脚本中输入的年份和月份(不是当前月份)获取过去 6 个月的年份和月份?
- javascript - 链接 onclick 不提交表单
- cisco - 我需要从 cisco 设备中获取一些信息。它是 cisco-ios-xe 设备
- java - Java 格式时间戳
- javascript - Nuxt Js - 在初始页面加载期间仅加载一次脚本
- python - 未定义 wsgi 应用程序名称“BASE_DIR”
- scripting - 使用相同图像构建多个服务器 - 一个不会运行特定的 crontab 行
- python - 使用 Python 获取字符串、拆分然后加入