That fold up table is very cool. I did something similar, but didn't have the sliding legs. I had a single car garage in the rent house I was in and didn't have a lot of room either. I don't have any pics, but I think I can describe it.
I wanted to have a little more substantial table that what has been shown so far, I used a 2x4 on the wall and a pair of 3" door hinges, but for the table itself, I framed up some 2x4s 12" apart and nailed 3/4" plywood on top. I think it was 24x60. I mortised the hinges into the 2x4s and added a piece of plywood on top of the 2x4 on the wall so when the bench was down it was a smooth surface with just the hinge barrels sticking up a bit. I used a similar dead bolt to hold the top agains the wall. I didn't use legs that went to the floor, I took a 24x24 square of plywood and cut it diagonally and attached it to the 2x4s on the wall where they could swing out when bringing the top down. I placed them where they would hit a 2x4 on the bottom of the top and put some 1x4s on either side of the 2x4 to make a groove for the triangle support to receive into. The one thing I wished I would have done was to put a piece of 1/4" plywood or masonite to cover the bottom, when the top was up, the 2x4 that ran across the bottom was a perfect shelf to put cans of brake cleaner, WD40, etc, on.