# Expand Table button shows wrong table

**URL:** <https://meta.discourse.org/t/expand-table-button-shows-wrong-table/230969>\
**Category:** Bug\
**Tags:** size-s\
**Created:** [June 24, 2022, 12:59am UTC](https://meta.discourse.org/t/expand-table-button-shows-wrong-table/230969 "2022-06-24T00:59:56Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [June 24, 2022, 6:32am UTC](https://meta.discourse.org/t/expand-table-button-shows-wrong-table/230969/3 "2022-06-24T06:32:44Z")

</div>

Oh I can see the bug here:

> <https://github.com/discourse/discourse/blob/7d41e980c90c7511f78a7645c51a52ea67a74322/app/assets/javascripts/discourse/app/initializers/post-decorations.js#L159-L164>

We are doing a naive query selector here, so it is **always** picking the first table in the post. Instead it should search for the first table **after** the button that was clicked.

We will get this sorted some time in the next month, thanks for raising.

---

_[View the full topic](https://meta.discourse.org/t/expand-table-button-shows-wrong-table/230969)._
