twitter-bootstrap 使用 Bootstrap 4 隐藏表格列
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/48292516/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Hide Table Columns using Bootstrap 4
提问by vbuser2004
I know that Bootstrap 4 uses new display utilitiesto show or hide information based on the screen size. My question is how to make these work with a table? I want to remove columns as the screen size is smaller.
我知道 Bootstrap 4 使用新的显示实用程序根据屏幕大小显示或隐藏信息。我的问题是如何使这些与表格一起工作?由于屏幕尺寸较小,我想删除列。
I have used "d-xs-none" and it does not have any effect. However, when I use "d-sm-none" the column is removed when the size is 'sm' or larger (the exact opposite of what I need). If I try "d-none d-xs-none" the column never shows up. As in: <th class="text-center d-none d-xs-none" scope="col">Location</th>
我使用了“d-xs-none”,但没有任何效果。但是,当我使用“d-sm-none”时,当大小为“sm”或更大(与我需要的完全相反)时,列将被删除。如果我尝试“d-none d-xs-none”,则该列永远不会出现。如: <th class="text-center d-none d-xs-none" scope="col">Location</th>
Basically, can you show me an example of hiding a table column when resizing the browser to a mobile device? Thank you for your help!
基本上,您能告诉我一个在将浏览器调整为移动设备时隐藏表格列的示例吗?谢谢您的帮助!
回答by Eleven
Try using d-none d-sm-table-cellfor table columns. Colums having these classes won't be shown on xs.
尝试使用d-none d-sm-table-cell表列。具有这些类的列不会显示在 xs 上。

