What size lumber can depend on how many legs you plan for and how they are arranged in the design.
Also the "are you planning on walking/crawling on top of it" aspect. (and that of course is different depending on a person's weight!)
I've used 2x3 for legs for years, but I also don't crawl on top of the tables in general (I'm sure I've done some leaning on my tables while standing on a stool, but not the table strictly holding all of my weight).
For a standard 4x8 board, I've used 6 legs, 4 in the corners and 2 mid-way on the long edge, right near the middle. I've used 1x4 or 1.25x4 as edge pieces (as well as a cross piece to span from one long edge to the other at the mid-way point) to screw the plywood down to and the legs to.
I've also done smaller "modules" to make a larger area made up of individual tables of maybe 2 foot by 6 foot surface area. For those, I only put legs in the corners.
-Dave