php - 防止 div 从表 th 中的新行开始
问题描述
如您所见,进度条与文本不符。该栏是一个单独的 div:
<th width="300px">
Atv opgenomen / totaal: 22:48 h / 62.0 h
</th>
<th>
<?php
echo '<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="'.$perc_bar_atv.'" aria-valuemin="0" aria-valuemax="100" style="width: '.$perc_bar_atv.'%;">
'.round($perc_bar_atv).'%
</div>
</div>';
?>
</th>
解决方案
似乎设置适当的边距.progress
就足够了,像这样:
.progress {
margin: 10px 0 !important;
}
或这个
.progress {
margin: auto 0 !important;
}
.progress {
margin: 10px 0 !important;
}
th {
border: 1px solid green;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<table>
<tr>
<th width="300px">
Atv opgenomen / totaal: 22:48 h / 62.0 h
</th>
<th width="300px">
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100" style="width: 100%;">50%</div>
</div>
</th>
</tr>
</table>
推荐阅读
- python - Mask R-CNN 中的预训练权重和初始化权重是什么?
- php - 尝试通过 CURL 发送消息后未经授权的 Discord 响应
- php - 按值和大小对多维数组进行排序
- java - 从应用程序到 Java 服务器的 Java Socket 连接
- reactjs - Redux - 未调用减速器
- applescript - 将删除的文件移动到文件夹 X,否则只需使用 Applescript 打开 X
- blazor-client-side - Blazor 的 OnInitializedAsync 事件在 DOM 完成之前触发
- azure-active-directory - Azure 应用程序网关 WAF:HTTP 错误 400。请求标头的大小太长
- python - 在 python spyder 中找不到模块“Tabula”
- sapui5 - CSS 样式不能动态设置(单元格颜色)