I believe that this can definitely be done with some custom CSS, let me play around with the components and see if there is something inside the inspector tab that could be this easier.
I believe there isn't but just want to double check. I believe that custom CSS is likely the best option because you can specify exactly how tall you want the components to be.
You can set a variable that can change on user event such as a button press which can then apply a CSS style using some ternary JS logic to apply either style 1 or style 2 which will represent the different sizes of the form and the table components inside the container.
The only auto-sizing options are based on fitting the content inside which will not be dynamic if you want users to be able to switch between two sizes for the table and form.