# CSS隐藏群组成员页面中的“发布”和“已查看”列

**URL:** <https://meta.discourse.org/t/css-to-hide-the-posted-and-seen-columns-in-the-group-member-page/182206>\
**Category:** Development\
**Created:** [2021年三月5日 16:02 UTC](https://meta.discourse.org/t/css-to-hide-the-posted-and-seen-columns-in-the-group-member-page/182206 "2021-03-05T16:02:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoelZaslofsky](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joelzaslofsky/32/158556_2.png) [@JoelZaslofsky](https://meta.discourse.org/u/JoelZaslofsky)\
**Post date:** [2021年三月5日 16:02 UTC](https://meta.discourse.org/t/css-to-hide-the-posted-and-seen-columns-in-the-group-member-page/182206/1 "2021-03-05T16:02:11Z")

</div>

自 Discourse 2.7.0.beta4 起，我们之前用于隐藏群组详情页面中“发布”和“已查看”列的自定义 CSS 已不再有效。现在，我们只保留“已查看”列。

 ![image](https://global.discourse-cdn.com/meta/original/3X/c/f/cfaf8e3c877c0aaeea9388eaa267f5fcf987cde8.png)

我希望在“发布”、“已查看”和“已添加”这三个列中，仅保留“已添加”列。以下 CSS 代码此前有效，但现在已失效。

```
/* 从群组详情成员列表中移除“发布”和“已查看”列 */
table.group-members th:nth-child(n+4):nth-child(-n+5), table.group-members td:nth-child(n+4):nth-child(-n+5) {
    visibility: hidden;
    width: 0px;
    font-size: 0px;
}

```

如何修改 CSS 以再次隐藏“发布”和“已查看”列？

如果以上内容不足以说明情况，这里有一个两分钟的视频，解释了整个情况。

[https://www.loom.com/share/f6cd2fa0628d4876a73ebb2a500d9bfa](https://www.loom.com/share/f6cd2fa0628d4876a73ebb2a500d9bfa)

---

<div class="post-metadata">

**Author:** ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)\
**Post date:** [2021年三月5日 16:54 UTC](https://meta.discourse.org/t/css-to-hide-the-posted-and-seen-columns-in-the-group-member-page/182206/2 "2021-03-05T16:54:19Z")

</div>

嘿 👋

感谢提供的视频。

该页面的表格标题多了一列，用于批量选择按钮。

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/f/aff7bdd7b18aba6089572c79f4b13aa52e6b7058.png)

因此，你的 `nth-child` 选择器偏移了一位。

试试这个，看看是否能解决你的问题。

```scss
.group-members {
  th {
    &nth-child(5),
    &nth-child(6) {
      display: none;
    }
  }
  td {
    &nth-child(4),
    &nth-child(5) {
      display: none;
    }
  }
}

```

我们近期不会对该布局进行任何更改。因此，在这里使用 `nth-child` 选择器应该没有问题。

---

<div class="post-metadata">

**Author:** ![JoelZaslofsky](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joelzaslofsky/32/158556_2.png) [@JoelZaslofsky](https://meta.discourse.org/u/JoelZaslofsky)\
**Post date:** [2021年三月5日 19:42 UTC](https://meta.discourse.org/t/css-to-hide-the-posted-and-seen-columns-in-the-group-member-page/182206/5 "2021-03-05T19:42:24Z")

</div>

你的 CSS 起作用了，非常感谢！

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [2021年四月4日 19:42 UTC](https://meta.discourse.org/t/css-to-hide-the-posted-and-seen-columns-in-the-group-member-page/182206/6 "2021-04-04T19:42:51Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
