【发布时间】: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