Is there any way to get the position of upper right cell in CellSelection in table?

I’m trying to make a widget that will always be in the upper right cell in CellSelection. I’ve tried so many different ways, but none of them seems to work, i don’t understand how to get the position of that cell, TableMap seems not really helpful, but maybe i’ve missed something, do you have any advises?

When I worked on a similar problem in the past, I added the DOM inside the cell by specifying the pos of the Decoration.widget, and set position: absolute and top: -10px in the CSS.
Note that IME composing and cursor movement could be broken in that case. ref: IME composing is not working when the cursor is in `th` tag · Issue #1251 · ProseMirror/prosemirror · GitHub