I would not even bother. While the idea seems attractive at first, i.e. keeping a table level, gimbaled is not the way to go. Once you start putting plates and food
on the table, you alter its center of gravity and it tips on its own in the direction of the heaviest set of items and dumps it in someones lap.
What you would really need, but probably could not afford (as it would run into the five or more digit category), is a gyro stabilized, servo controlled tri-axle table which will keep the table top level regardless of boat motion and the load carried on the table.