Doesn't that get in the way while sleeping? Don't you ever knock it down?
What I would do is connect it the opposite way round. So that it folds down, not up. Give it a little leg that folds out when you pull it up.
The leg could be done in a few ways. But I would prefer it so that it is connected to the table top's underside on a hinge. So, when the table is folded down the leg is tucked behind it, and when you pull the table up, the leg "drops" down and upright.


