The strength of the table will be based on the amount of cross bracing you use, and the distance between the legs. My legs are about 30" to 36" spacing. I connect my leg structure with cross braces both above and below the 2x4 legs (this creates a rectangle), then have cross bracing, again at the top and bottom of the legs connecting the leg "rectangles" together. You can use 1x3 for this at the back, and 1x2s at the top and bottom. Based on your table height, you may need to have some "X" cross bracing to keep things from moving side to side. My layout utilises the corner walls to prevent side movement of the table. The table is not attached to the walls, however the walls give it stiffness support.
I covered my layout in carpet underpad, then painted the underpad with brown "earth coloured paint" mixed 50-50 with water to allow more time to dry. (painting carpet underpad may suck the water out of the paint before the paint cures and dries, so I use a watery paint mixture to provide extra drying time.) While still wet, I sprinkle on grass texture (coloured sawdust) and some N-scale ballast to provide a basic ground appearance. After the paint dries, you brush off the excess ground cover and re-use it. You can then add more layers later, after the track is in place. This gives the layout a good look quickly. With the carpet underpad, you can run wires between the table top and underpad, then poke it through under the track, operating accessory or building as needed. If you decide to change the location of a building or track, you just move the wire. The underpad naturally "seals" the cut needed for the wire.
My layout signal system uses lots of phone wire for occupancy detection, so all these wires run under the underpad, and I just poke them through at the track connection point. This eliminates the need to have small wire holes in the tabletop "all over the place".
You can easily stand or kneel on the underpad, as it was almost designed to withstand the weight of a person. If you use foam, you have to be a little more careful of standing on top of it as it can be indented by your weight. The advantage of the carpet underpad, is I can move things around easily, so as a result, my layout went up quickly, and I have moved track and buildings all over the place. After every York trip, I learn more, buy more and stuff gets moved.