# [Charcoal], 64 bytes

    WS⊞υι≔Eθ⪫⪪⭆υ§λκ-|¦#|υFυFΦ⪪ι#λ«P↓№κ|→→»←⸿⸿FE§υ⁰⌕A⭆υ§λκ#Wι«⊕⁻⊟ι⊟ι→

[Try it online!][TIO-kzvoisyl] Link is to verbose version of code. Takes input as a rectangular list of newline-terminated strings. Explanation:

    WS⊞υι

Input the stack of tables.

    ≔Eθ⪫⪪⭆υ§λκ-|¦#|υ

Transpose the stack and identify the ends of the tabletops i.e. those parts above the legs.

    FυFΦ⪪ι#λ«

For each column of the original stack split it on tabletop ends, dropping the first element (which is the space above the first end) and loop over the resulting legs.

    P↓№κ|→→

Print the length of the leg vertically (which Charcoal automatically translates into a line of `|`s) without moving the cursor and then allow two columns for the next leg.

    »←⸿⸿

Move up to the start of the previous row but one.

    FE§υ⁰⌕A⭆υ§λκ#

Transpose the stack back and find all of the tabletop ends.

    Wι«⊕⁻⊟ι⊟ι→

Loop over the ends in pairs, print the inclusive difference between each pair (which Charcoal automatically translates into a line of `-`s) and then allow a column for the next tabletop.

[Charcoal]: https://github.com/somebody1234/Charcoal
[TIO-kzvoisyl]: https://tio.run/##pZAxa8MwEIXn6lcIdzmBBZ2TybQEXGowzZrF2Ep8RJVcWUoKVX67e46TqXU65JaHdO/efVLdVq62lR6GY4tacchNF/zaOzQ7EIKXoW8hpBzFkmV9jzsDRdXBZ8pfLRpYdxo9TPbxnpyZz02jvkCnfC9EyhMZk1EeSUgDBW2t4xAEP@sKtVfukoSjcbRr2v3NHoqgPXaU7mHxYo8m5c820GFPvjFvSRZ7ULB4x13rfx9PrJyG39TW08zGbVxyJRiBr7QE/kRrV2iaTOt/XkSEhHf5MDyDTmtyUzv1oYxXDRRoQg@l7ciR8knFH8SnYeDzJaVkcr4ijyzODsf72/JmsXiz7mwP8qB/AA "Charcoal – Try It Online"