【问题标题】:Set width in Bootstrap td在 Bootstrap td 中设置宽度
【发布时间】:2016-12-14 09:40:19
【问题描述】:

我有这张表,我想让点按钮单元格的宽度等于按钮宽度。 我怎样才能使它成为可能? 而且我会制作没有边框和背景颜色的整个单元格,但我不知道我该怎么做。我认为有一个 Bootstrap 类在干扰。

<div class="col-md-12 column table-responsive" id="tablaPagos" style="padding-right:0;">
    <table class="table table-bordered table-hover" id="tabla_cobros_programados">
        <thead class="thead-gray">
            <tr>
                <th class="col-md-2 text-center">
                    Fecha
                </th>
                <th class="col-md-3 text-center">
                    Concepto
                </th>
                <th class="col-md-3 text-center">
                    Monto
                </th>
                <th class="col-md-3 text-center">
                    Detalle
                </th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>
                    <p class="text-center">22/08/2016</p>
                </td>
                <td>
                    <p class="text-center">Fotocopias<p></p>
                </td>
                <td>
                    <p class="text-center">1800</p>
                </td>
                <td>
                    <p class="text-center">1000 fotocopias</p>
                </td>
                <td class="pull-right">
                    <i class="fa fa-ellipsis-v" aria-hidden="true"></i>
                </td>
            </tr>
        </tbody>
    </table>
</div>

【问题讨论】:

    标签: twitter-bootstrap button width html-table


    【解决方案1】:
    1. 要将点按钮单元格的宽度设置为等于按钮宽度,请从最后一个 td 中删除类 pull-right

    2. 让整个单元格没有边框,没有背景颜色写在css中:

       td{
        text-align:center;
        border:none!important;
        background:transparent;
        color:#fff;
       }
      
       table{
        background:transparent!important;
       }
      

    如果您也想从单元格中删除边框,也只需应用相同的 css 即可。

    这里正在工作example

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-07-08
      • 1970-01-01
      • 1970-01-01
      • 2013-09-01
      • 1970-01-01
      • 2018-09-02
      • 1970-01-01
      相关资源
      最近更新 更多