I got fed up with my power cable slipping under the table every time I unplugged my laptop, so I created a small part that would let the cable go through relatively easy but prevent it from slipping off the edge of the table.
I was looking for a way to attach the clip to the table that does not involve a complicated mechanism, so I decided to go with press-fit.
To make the holder stay put better, I attached rubber pads to the top and bottom of the clamp, using Gorilla Glue Gel.
The part is customizable in Fusion 360, I suggest setting these parameters:
CableRadius (please note this is NOT the diameter, but the radius of the cable)
PaddingThikness (if you use some other material than the foam sheet, see the picture)
Just make sure you print the part on its back (like in the attached pictures) and let the slicer generate supports.