My brother marks his undergrad's papers from his bathtub, and frequently computes there. He has a wood board that goes across the tub. A compromise of ergonomics, but, he maintains its still the best.
So the legs would be like 4 inches and fit into the inside walls of the tub preventing the edge from slipping off the small ledge between the tub and the wall.
That way I could still code with the bathtub more than half full.
I'm about as far from a handyman as you can get, but I did manage to make one of these myself. The legs are only about 2" tall, but it sits snug with less than 1/8" wiggle room. While I don't use mine for bringing the laptop to the tub, it has been a delight for books and drinks.