Nope. You have to calculate the torque about the fulcrum, which is the intersection of r and the line that connects the two legs.
The only way I can see to do this properly is with calculus, though. You can't quite consider the mass of the table to be concentrated at the center of mass, since some of the table will hang over its support base.
If you do consider the table's mass to be concentrated at center of mass, then the problem is easier. Sum the torques and set equal to zero. Solve for object mass.
Chemists are physicists who don't do math.
