I have an ikea desk with the desk top is 23mm thick. This attaches to the side of the desk to hold my SD cards, USB sticks, and micro SD cards.
I used anti slip tape on the top and bottom parts that connect with the table. It creates a really tight fit. I also used double sided tape on the inside (the red tape you can see in the picture) to further stick it.
Either solution is fine on its own. The anti slip tape adds just enough friction that you don't really need the double sided tape.
Link to the anti slip tape I used:
https://www.amazon.com/gp/product/B07MKG5BRF
I printed this in 0.3mm with support for the overhang. Pretty much any option works but will probably need to enable supports.
The author hasn't provided the model origin yet.