Actually, those types of tables have existed since the 19th century, some with manual insertion of extensions, and some with more elaborate mechanisms.
Here is a neat article about an early design: https://www.rauantiques.com/blog/mechanical-furniture/