Jelly, 23 bytes
="|μZṣ0ドルẎ1Ƈ,<ƝT€Fr2/ƲẈ€
A monadic Link accepting a list of lines that yields a list of lists of leg lengths and tabletop lengths.
How?
="|μZṣ0ドルẎ1Ƈ,<ƝT€Fr2/ƲẈ€ - Link: list of lists of characters, L
="| - L equals '|'? (vectorises)
μ - new monadic chain - f(X=that)
Z - transpose X
ṣ0ドル - split each at zeros
Ẏ - tighten
1Ƈ - keep truthy (non-empty) ones
-> our legs (as lists of 1s)
Ʋ - last four links as a monad - f(X):
Ɲ - for neighbours:
< - less than?
T€ - truthy indices of each
F - flatten
2/ - reduce pairs by:
r - inclusive range
-> our tabletops (as lists of positive integers)
, - pair legs and tabletops
Ẉ€ - for each: length of each
Jelly, 23 bytes
="|μZṣ0ドルẎ1Ƈ,<ƝT€Fr2/ƲẈ€
A monadic Link accepting a list of lines that yields a list of lists of leg lengths and tabletop lengths.
How?
="|μZṣ0ドルẎ1Ƈ,<ƝT€Fr2/ƲẈ€ - Link: list of lists of characters, L
="| - L equals '|'? (vectorises)
μ - new monadic chain - f(X=that)
Z - transpose X
ṣ0ドル - split each at zeros
Ẏ - tighten
1Ƈ - keep truthy (non-empty) ones
-> our legs (as lists of 1s)
Ʋ - last four links as a monad - f(X):
Ɲ - for neighbours:
< - less than?
T€ - truthy indices of each
F - flatten
2/ - reduce pairs by:
r - inclusive range
-> our tabletops (as lists of positive integers)
, - pair legs and tabletops
Ẉ€ - for each: length of each
Loading