【发布时间】:2018-07-14 10:42:18
【问题描述】:
这是我在 StackOverflow 中的第一个问题,因为这是我第一次找不到可以帮助我解决问题的答案。
我正在尝试为带有引导程序的菜单制作表格。我希望早餐、午餐和晚餐栏的宽度各为 30%,而其中的栏目显示碳水化合物、脂肪和蛋白质为 10%,但我无法让它发挥作用。
我通读了the documentation,实际上发现了一个非常相似的问题here。但是,我仍然无法使其工作。
我输入了我的代码here in CodePen,这样你就可以看到我所看到的了。
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<table class="table table-bordered">
<thead>
<tr class="m-0">
<th class="w-10">#</th>
<th class="w-30">Breakfast</th>
<th class="w-30">Lunch</th>
<th class="w-30">Dinner</th>
</tr>
</thead>
<tbody>
<tr class="m-0">
<th scope="row" class="w-10">Carbohydrates</th>
<td class="w-30">-
</td>
<td class="w-30">
-
</td>
<td class="w-30">-
</td>
</tr>
<tr class="m-0">
<th scope="row" class="w-10">Fat</th>
<td class="w-30">-
</td>
<td class="w-30">
-
</td>
<td class="w-30">-
</td>
</tr>
<tr class="m-0">
<th scope="row" class="w-10">Proteins</th>
<td class="w-30">-
</td>
<td class="w-30">
-
</td>
<td class="w-30">-
</td>
</tr>
</tbody>
</table>
谁能帮我找出我缺少的东西?我刚刚自学编码大约 3 个月,上周开始使用 bootstrap,所以我希望它不是很明显。
提前致谢!
【问题讨论】:
标签: html bootstrap-4