The physics
A liquid's surface pulls along its edge. The pull on each metre of edge is the surface tension S.
The contact angle θ lies between the wall and the liquid's surface. Measure it inside the liquid. Water on clean glass has θ = 0. Mercury on glass has θ near 140°.
In a thin tube, the surface pulls up around the rim with 2πr × S cos θ. The column climbs until its weight πr²hρg equals that pull.
h = 2S cos θ / (ρ g r)
Above 90°, cos θ is negative. Then h is negative too, and the liquid sinks below the outside level.
The rise also equals 2S/(ρgR). Here R is the radius of the liquid's curved top. A short tube stops the column at its rim. The top then flattens, and h × R stays the same. Nothing spills.
A leaning tube keeps the same height, so its column is longer. In a lift, use g + a. Only the glass at the top edge sets the height.
ℓ = h / cos α h = h₀ g / (g + a)