css - 在移动 View 中如何隐藏表格中的某些列?

标签 css twitter-bootstrap mobile twitter-bootstrap-3

此链接适用于桌面 View Desktop View . 如果用于移动 View ,则此链接。 Mobile View .

如何使移动 View 中的这些列看起来像桌面 View 中的列。

这是我的 CSS 代码。顺便说一下,我使用 gridview 来显示表格。

CSS:

    #data {
     display: block;
     margin:20px;
     width:95%;
     height: 400px;
     overflow-y: scroll;
   }
  @media only screen and (max-width: 800px) {
    #data td, th {
        display:none;
    }
        #data th:nth-child(1),
        #data td:nth-child(1),
        #data th:nth-child(4),
        #data td:nth-child(4),
        #data th:nth-child(14),
        #data td:nth-child(14),
        #data th:nth-child(56),
        #data td:nth-child(56),
        #data th:nth-child(57),
        #data td:nth-child(57),
        #data th:nth-child(66),
        #data td:nth-child(66) {display:block;}

}

@media only screen and (max-width: 640px) {
    #data th:nth-child(1),
        #data td:nth-child(1),
        #data th:nth-child(4),
        #data td:nth-child(4),
        #data th:nth-child(14),
        #data td:nth-child(14),
        #data th:nth-child(56),
        #data td:nth-child(56),
        #data th:nth-child(57),
        #data td:nth-child(57),
        #data th:nth-child(66),
        #data td:nth-child(66) {display:block;}
}

最佳答案

对于这种情况,您可以在内置类中使用 Bootstrap ,例如

.hidden-xs{
    /*By adding class to the div will be hidden in phones and will be visible in desktop*/
}

更多类(class)可以引用link .

关于css - 在移动 View 中如何隐藏表格中的某些列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30701649/

相关文章:

javascript - 如何找到 '' Outlook 兼容邮件设计器工具”

javascript - 显示的 Angular Bootstrap 进度条进度不正确

javascript - Jquery 移动下拉菜单

javascript - 在 HTML 对象上放置阴影

javascript - 如何添加和删除输入字段

twitter-bootstrap - 有没有办法在 Github Wiki 上显示进度条?

jquery - CSS 移动版切换回桌面

php - Android - 谷歌云消息传递的高优先级消息(使用 corona sdk)

jquery - 如何通过在网站jquery的其他地方点击关闭菜单

html - 内联表单 MVC