我试图在 col-xs
和 col-sm
中隐藏响应式设计的列。我首先尝试使用 hidden-xs/hidden-sm
类,但这没有用。我还尝试使用 visible-desktop
,如下所述:Twitter Bootstrap Responsive - Show Table Column only on Desktop
那也没用。做这个的最好方式是什么?我宁愿不做两个单独的表,然后隐藏一个或另一个。
我试过但目前无法运行的代码:
<table>
<thead>
<th>Show All the time</th>
<th class="hidden-xs hidden-sm">Hide in XS and SM</th>
</thead>
<tbody>
<tr>
<td>Show All the time</td>
<td class="hidden-xs hidden-sm">Hide in XS and SM</td>
</tr>
</tbody>
</table>
最佳答案
似乎 hidden-xs/hidden-sm
之前工作过,因为接受的答案有很多赞成票,但是当我调整区域大小时, fiddle 示例对我不起作用。不过,对我有用的是使用 visible-md/visible-lg
的相反逻辑。我不明白为什么,因为根据文档 Bootstrap 应该仍然支持 hidden-xs/hidden-sm .
工作 fiddle :http://jsfiddle.net/h1ep8b4f/
<table>
<thead>
<th>Show All the time</th>
<th class="visible-md visible-lg">Hide in XS and SM</th>
</thead>
<tbody>
<tr>
<td>Show All the time</td>
<td class="visible-md visible-lg">Hide in XS and SM</td>
</tr>
</tbody>
</table>
关于html - 使用 Bootstrap 3 如何隐藏表中的列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18362893/