我需要增加评级列宽度,但我的 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>
最佳答案
如果您查看 Bootstrap 文档 Sizing doc你会发现他们已经包含了对25%、50%、75%、100%和auto的支持,所以基本上当你使用w-9
时,类是空的
因此,如果您无法修改 css 文件,您需要将以下属性放入 td 标记中:
<td style="width:9%">
关于php - Bootstrap 4表格td宽度尺寸自定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51899741/