php - Bootstrap 4 表 td 宽度尺寸自定义
问题描述
我需要增加评分栏的宽度,但我的 w-9 不起作用。我想扩大评分栏。
这是我的表格代码:
<table class="table table-bordered stick-top">
<thead class="text-center" id="data">
<tr>
<th></th>
<th>Questions</th>
<th id="try">Rating</th>
</tr>
</thead>
<tbody class="body_data">
<?php
$jio=mysqli_query($conn,"SELECT * FROM question")or die ("error");
while(list($Question_ID,$Question_Description)=mysqli_fetch_array($jio))
{ ?>
<tr>
<td><?php echo $Question_ID; ?></td>
<td><?php echo $Question_Description; ?> </td>
<?php
$q1 = "SELECT * FROM rating ORDER BY Rating_ID ASC";
$r1 = $conn -> query($q1);
echo "<td class='w-9'";
while($row = $r1 -> fetch_object()){
echo "<input id='radio' type='radio' name='radio$Question_ID' value='" . $row -> Rating_ID . "' required>". $row -> Rating_ID;"";
}
echo "</td>";
?>
</tr>
<?php } ?>
</tbody>
</table>
解决方案
如果您在Sizing doc中查看 Bootstrap Doc, 您会发现它们已包含对25%、50%、75%、100% 和 auto的支持,所以基本上当您使用w-9
该类时为空
因此,如果您无法修改 css 文件,则需要将以下属性放在 td 标签内:
<td style="width:9%">
推荐阅读
- xml - 即使缺少分组键,也可以在 XSLT 中对元素进行分组
- c++ - 如何通过不同的指针使用类的对象访问结构?(链接列表)(C++)
- node.js - 如何对 Id 字段执行验证?
- javascript - 将视频的上半部分绘制到画布 html
- ruby - 如何在 Ruby 中写入 Windows 文件属性?
- powerbi - 使用脱机数据保存 Power BI 报表
- javascript - 布尔变量似乎无缘无故地变为真
- python - Python:删除节点链表
- android - 缓慢构建和安装android。如何构建和安装更少的时间
- css - 跨度元素上的动态 CSS 类 - 角度 4