Robert,
Yes a 42 x 42 table would work.
An O-31 circle of track will occupy 31" of surface area across the diameter
So if you're using a circle of O-31 track you can put it on a table with a 31" top.
but I would suggest that you go at the least 4"- 6" larger than your circle of track.
(extra width gives a place for your trains to land in case of a derailment rather than
falling to the floor.)
Happy Rails!
Dave