guess I'm just going to go with small hinges holding the shelf to the wall so it will lay down against the wall when not in use. Then a length of 1x on a hinge below the shelf - tip the shelf up - tip the 1x up till it fits in a pocket on the underside of the shelf
should work ok for most smallish shelf/table set ups I have in mind - as long as the table is hinged solid enough that putting a little weight on an outside corner couldn't 'tip' the table of the 1x support...I think it will be fine I'll try and post a pic if I get one built this weekend