# How to select table cells

**URL:** <https://discuss.prosemirror.net/t/how-to-select-table-cells/4340>\
**Category:** Uncategorized\
**Created:** [January 14, 2022, 7:25pm UTC](https://discuss.prosemirror.net/t/how-to-select-table-cells/4340 "2022-01-14T19:25:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeremy](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/jeremy/32/2554_2.png) [@jeremy](https://discuss.prosemirror.net/u/jeremy)\
**Post date:** [January 14, 2022, 7:25pm UTC](https://discuss.prosemirror.net/t/how-to-select-table-cells/4340/1 "2022-01-14T19:25:40Z")

</div>

Hello, I noticed in the Prose Mirror example at [ProseMirror basic example](https://prosemirror.net/examples/basic/) , you were able to implement selecting a parent node. I can’t quite figure out your code. I’m trying to figure out how to select a table and its cells, then use a button to apply styling to the table and cells. How would I do that?

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)\
**Post date:** [January 15, 2022, 4:40pm UTC](https://discuss.prosemirror.net/t/how-to-select-table-cells/4340/2 "2022-01-15T16:40:51Z")

</div>

Depending on what you mean by selecting cells, you might be able to take inspiration from the cell selection in [prosemirror-tables](https://github.com/ProseMirror/prosemirror-tables/blob/master/src/cellselection.js) – that is a custom selection class that represents a selection across a few cells in a table. Basically, ProseMirror supports different selection types (coming with text selections, which start and end in text positions, and node selections, which select a single node, by default), but allowing user code to implement additional types by subclassing [`Selection`](https://prosemirror.net/docs/ref/#state.Selection).

---

<div class="post-metadata">

**Author:** ![jeremy](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/jeremy/32/2554_2.png) [@jeremy](https://discuss.prosemirror.net/u/jeremy)\
**Post date:** [January 18, 2022, 3:44pm UTC](https://discuss.prosemirror.net/t/how-to-select-table-cells/4340/3 "2022-01-18T15:44:37Z")

</div>

Thank you for your help
