CSS to hide the Posted and Seen columns in the group member page, take 2

Following up on this forum thread from March 2021:

The CSS to hide the “Posted” and “Seen” columns from the group detail member lists in desktop view now hides the Accept and Deny buttons when a group is set to have to request to join.

Here’s the CSS that needs to be modified or replaced.

/* Remove "Posted" and "Seen" columns from group-detail member lists */
.group-members {
  th {
    &:nth-child(5),
    &:nth-child(6) {
      display: none;
    }
  }
  td {
    &:nth-child(4),
    &:nth-child(5) {
      display: none;
    }
  }
}

Here’s a video that shows the tradeoff between using the nth-child CSS code and having the Accept and Deny buttons disappear:

https://www.loom.com/share/d066ea1a765a4ce4b3b13a952f98fb1b

Thanks in advance to the kind person who provides some more targeted CSS so I can hide just the Posted and Seen columns without hiding anything else at https://[yourdiscourseforumurl].com/g/[YourGroupName]

2 Likes

Hello,

This is a tricky one because as I see there is no any specific class to target. But I think I found CSS solutions, so it can be achievable without modify the template. :slightly_smiling_face:

The problem is with the td hasn’t got specific classes what you can easily target but you can target what inside it.

This CSS will check what inside the td and if it’s a span it will hide (the dates are in span). But on the request page the buttons are button so this CSS won’t hide the buttons td.

/* Remove "Posted" and "Seen" columns from group-detail member lists */
table.group-members {
  th {
    &:nth-child(4),
    &:nth-child(5) {
      display: none;
    }
  }
  td {
    &:nth-child(4),
    &:nth-child(5) {
      > span {
        display: none;
      }
    }
  }
}

Other method :arrow_down_small:

However you can target the bulk-select on table head row and group-owner class on table body row. This CSS only activate where the bulk-select and group-owner class is appear. These are not appears on request page so this won’t activate.

/* Remove "Posted" and "Seen" columns from group-detail member lists */
table.group-members {
  th.bulk-select {
    + th + th + th,
    + th + th + th + th {
      display: none;
    }
  }
  td.group-owner {
    + td + td,
    + td + td + td {
      display: none;
    }
  }
}

Hope this helps :slightly_smiling_face:

3 Likes

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