我正在尝试修复列的宽度(名称:链接)但无法在下面执行此操作是我的代码
<table class="table table-striped table-bordered">
<thead>
<th>ID</th>
<th>User</th>
**<th class="col-sm-2">Link</th>**
<th>Charge</th>
<th>Start count</th>
<th>Quantity</th>
<th>Type</th>
<th>Status</th>
<th>Date</th>
但是表的输出没有变化,你能告诉我我做错了什么吗?
最佳答案
您的 html 没有关闭 thead
或 table
,但是当您正确设置 html 格式时,列类会起作用。许多人使用 table 上的类(class)。
.col-sm-2
从 min-width:768px 开始,它是父级(表格)宽度的 16.6666666666667%。它将保持该最小宽度的 16.6666666666667% 及以上,并将恢复为默认宽度。
<table class="table table-striped table-bordered">
<thead>
<th>ID</th>
<th>User</th>
<th class="col-sm-2">Link</th>
<th>Charge</th>
<th>Start count</th>
<th>Quantity</th>
<th>Type</th>
<th>Status</th>
<th>Date</th>
</thead>
</table>
关于css - 无法修复 Bootstrap 中的列宽,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27216621/