# How can I show grouped items in a table?

**URL:** https://community.weweb.io/t/how-can-i-show-grouped-items-in-a-table/3426
**Category:** Ask us anything
**Created:** [July 7, 2023, 5:57pm UTC](https://community.weweb.io/t/how-can-i-show-grouped-items-in-a-table/3426 "2023-07-07T17:57:50Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![stefank](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/stefank/32/4202_2.png) [@stefank](https://community.weweb.io/u/stefank)
#### Post date: [July 7, 2023, 5:57pm UTC](https://community.weweb.io/t/how-can-i-show-grouped-items-in-a-table/3426/1 "2023-07-07T17:57:50Z")

</div>

Hi all,

I want to display collection items in a table or collection list. It’s a list of sales data and I need to show them grouped by the publisher company. I thought I could nest a table in another table. So the first table would be the list of grouped items, the second table inside the first table would show the single elements of each group.

As soon as I manipulate my array, I get the “Empty Items” error Any Idea how I can solve that?

 ![Bildschirmfoto 2023-07-07 um 19.46.35](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/e/eadba47f597a2a6d10c48876665fbf744a6717c4.png)

 ![Bildschirmfoto 2023-07-07 um 19.47.08](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/a/a9afa41f44bda8cf6ceb4e239ec721a87596e645.png)

Thank you very much.

Best,  
Stefan

---

<div class="post-metadata">

### Author: ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)
#### Post date: [July 7, 2023, 6:41pm UTC](https://community.weweb.io/t/how-can-i-show-grouped-items-in-a-table/3426/2 "2023-07-07T18:41:34Z")

</div>

Hi @stefank 👋

I think you might be able to do it with one table.

Just released [this video](https://youtu.be/cWO8daMJ3Vk) that covers a similar use case.

The first 2 minutes explain how `filterByKey` formula works. If you’re already familiar with it, you can skip right to the [grouping implementation](https://youtu.be/cWO8daMJ3Vk?t=125).

Does that help?

---

<div class="post-metadata">

### Author: ![stefank](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/stefank/32/4202_2.png) [@stefank](https://community.weweb.io/u/stefank)
#### Post date: [July 10, 2023, 1:31pm UTC](https://community.weweb.io/t/how-can-i-show-grouped-items-in-a-table/3426/3 "2023-07-10T13:31:11Z")

</div>

Hi @Joyce,

Thank you so much, that helped a lot. There couldn’t be a better time for this video. I managed to group my items accordingly. I have a follow-up question. Is there a way to show a dynamic headline for every group? Like in my case I want to show the name of the publisher on top of the group.

 ![Bildschirmfoto 2023-07-10 um 15.25.24](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/e/e97cf7ee71187eb19fffb873f93fd6f02272f8e5.png)

Best,  
Stefan

---

<div class="post-metadata">

### Author: ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)
#### Post date: [July 12, 2023, 1:55pm UTC](https://community.weweb.io/t/how-can-i-show-grouped-items-in-a-table/3426/4 "2023-07-12T13:55:30Z")

</div>

Hi @stefank 👋

Hard to answer specifically because I’d have to rebuild exactly the same use case but I’d say finding a way to make the name of publisher container a repeated element would be the key here.

---

<div class="post-metadata">

### Author: ![stefank](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/stefank/32/4202_2.png) [@stefank](https://community.weweb.io/u/stefank)
#### Post date: [July 12, 2023, 4:42pm UTC](https://community.weweb.io/t/how-can-i-show-grouped-items-in-a-table/3426/5 "2023-07-12T16:42:21Z")

</div>

I was able to get the result with two nested tables.

---

<div class="post-metadata">

### Author: ![hicksmadison](https://avatars.discourse-cdn.com/v4/letter/h/a88e57/32.png) [@hicksmadison](https://community.weweb.io/u/hicksmadison)
#### Post date: [March 1, 2024, 5:16pm UTC](https://community.weweb.io/t/how-can-i-show-grouped-items-in-a-table/3426/6 "2024-03-01T17:16:36Z")

</div>

How do you nest tables?

---

<div class="post-metadata">

### Author: ![stefank](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/stefank/32/4202_2.png) [@stefank](https://community.weweb.io/u/stefank)
#### Post date: [March 4, 2024, 11:25am UTC](https://community.weweb.io/t/how-can-i-show-grouped-items-in-a-table/3426/7 "2024-03-04T11:25:38Z")

</div>

You can create a table and inside of a cell of this table you can display another table. Neat for some use cases.
