Oh! Grow Up!
Here's a riddle; How do you grow a four-foot plant in an eighteen inch spot? Give up? Grow vertically! This heirloom ‘lemon cucumber', (Cucumis sativus 'Lemon'), needs plenty of room; at least 4 feet with its vines of up to eight feet long! Trained on this trellis, its footprint is only 12×12 inches.

In addition to saving space, growing vertically makes for nicer shaped fruit, reduces contact with diseases, critters, and pests in or on soil, makes harvesting easier, and it adds interest to your garden.
Plants will need training, which I find really fascinating. This trellis is an obelisk that adds a bit of style, but trellises can be strings, wood, wire, tomato cages, or whatever materials you have on hand.

To train them, you will need to monitor and guide their tendrils. Tendrils are thin, thread-like growths present on the stem or leaves of climbing plants. They are touch-sensitive andthigmotropic, meaning they grow towards anything they encounter. They help plants reach for sunlight.

I was able to gently uncoil tendrils and wrap and weave the stems and tendrils on to the trellis. The tendrils continued to wrap around on their own; sometimes within hours! You can also tie the vines onto the structure using twine, choose-a-size metal twist ties, plastic flexible ties, or plant clips.
https://getbusygardening.com/growing-cucumbers-on-trellis/
https://savvygardening.com/cucumber-trellis/
https://ucanr.edu/blogs/blogcore/postdetail.cfm?postnum=14203