What would be the simplest way to draw a rectangle and then dividing it into 2 by double-clicking on it?

|___________________| draw a rectangle (the easy part)

|________|__________| double-click divides it into two

|__**|**|____| another double-click divides it again

|*|***|**__________| click and drag on vertical sides can stretch or shrink the rectangles

I’d like to put some centered text into each box later on (sort of like spreadsheet). I only need to resize horizontally (fixed height).

It looked easy at first, but I’m not sure how to keep my thoughts simple.

Any suggestion would be appreciated. Thanks.