Measure from the floor to the top of the seat cushion with nobody sitting on it. That number is your target table height. A table 0.8 to 2 in lower still works, because you reach slightly down to a cup; a table more than about 2 in above the seat forces your elbow up.
Most European and American sofas sit between 16 and 18 in. That is why the useful coffee-table range is roughly 16 to 18.9 in, and why a 21.5 in table next to a 16.5 in sofa feels like a desk.

