为了账号安全,请及时绑定邮箱和手机立即绑定

防止div在表中换行

防止div在表中换行

慕森卡 2023-10-04 15:18:40
正如您所看到的,进度条与文本不一致。栏是一个单独的 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>有什么建议如何使其内联吗?我已经尝试过了style="display: inline",可行,但删除了一些标记style="display: inline-block; vertical-align:center"给出
查看完整描述

1 回答

?
临摹微笑

TA贡献1982条经验 获得超2个赞

似乎设置适当的边距就.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>


查看完整回答
反对 回复 2023-10-04
  • 1 回答
  • 0 关注
  • 42 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信