html - thead-dark 在使用引导程序的角度项目中不起作用
问题描述
我尝试添加thead-dark
到我的表中,但不起作用。我正在使用引导程序。
我的代码:
<table class="table">
<thead class="thead-dark">
<tr>
<th>Name</th>
<th>Price</th>
<th>Units In Stock</th>
</tr>
</thead>
引导程序:
....
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
....
它的最后一个版本的引导程序不支持黑暗?
如何进行?
解决方案
你能检查下面的代码吗?希望它对你有用。在最新版本的引导程序中,我们可以使用“table-dark”类代替“thead-dark”。thead
您可以在、tr
和中使用“table-dark”类td
。
请参考此链接: https ://jsfiddle.net/yudizsolutions/qomrf9pk/
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
<table class="table">
<thead class="table-dark">
<tr>
<th>Name</th>
<th>Price</th>
<th>Units In Stock</th>
</tr>
</thead>
<tbody>
<tr>
<td>Demo Name</td>
<td>500</td>
<td>50</td>
</tr>
</tbody>
</table>
推荐阅读
- php - 如何使用数据库中的国家/地区填充 Jvector 地图?
- r - R聚合 - 命名结果列
- python-2.7 - 使用 SUBPROCESS.POPEN.COMMUNICATE() 方法时,从 Cloud Firstore 获取数据会导致 OSError
- python - 使用 dask 阅读时如何跳过坏行?
- backbone.js - 导航到 Backbone.js 中的不同视图后,如何取消绑定子视图?
- php - 在每个循环结束时删除循环内创建的 XML 元素
- autocad - 按 dxf 组对齐文本
- python - 实现 TD-Gammon 算法
- python-3.x - 我的十进制到二进制转换器有什么问题?
- r - 子集函数中的下标超出范围