【问题标题】:Additional borders and wrong display when using class="d-none d-sm-block d-md-block" bootstrap使用 class=\"d-none d-sm-block d-md-block\" bootstrap 时额外的边框和错误显示
【发布时间】:2023-02-11 04:45:10
【问题描述】:

我需要在移动设备上隐藏表格的某些列。 我使用 d-none d-sm-block d-md-block 在中小尺寸屏幕上执行此操作。

这是我的代码:

    <table border="1px" class="table table-hover">
    <thead class="thead-dark">
    <tr>
      <th class="d-none d-sm-block d-md-block">Fund</th>
      <th>Why them</th>
      <th>How to donate</th>
    </tr>
    </thead>
    {% for fund in funds_list %}
        <tr>
          <td class="d-none d-sm-block d-md-block"> <a href={{ fund.url }} target="_blank" rel="noopener noreferrer">{{ fund.name }}</a></td>
          <td> {{ fund.description|safe }}</td>
          <td> <a href={{ fund.bank_details }} target="_blank" rel="noopener noreferrer" class="btn btn-primary stretched-link">Go to website</td>
        </tr>
    {% endfor %}
</table>

当我不添加这些类时,我的表看起来很好:

但是,在我添加 class="d-none d-sm-block d-md-block" 之后,我想隐藏的列周围出现了一些奇怪的边框:

【问题讨论】:

    标签: python css django bootstrap-4 django-templates


    【解决方案1】:

    试试这个改变堵塞经过表格单元格

    class="d-none d-sm-table-cell..
    

    【讨论】:

      猜你喜欢
      • 2022-01-17
      • 2022-08-05
      • 2018-03-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-18
      • 1970-01-01
      • 2013-05-09
      相关资源
      最近更新 更多