Working on a dynamic HTML/CSS layout that simplifies the process by using classes like form, row, cell label, and cell input to control elements (width, alignment, etc.).
I decided to utilize display: table
along with its child elements table-row
and table-cell
as they address most of the layout issues seamlessly without requiring workarounds. The objective is to achieve a design where placing 2 containers inside a cell automatically assigns them 50% width, or 33% for 3 containers, 25% for 4, and so forth:
https://i.sstatic.net/Nv4Lx.png
The challenge I'm facing is that tables nested within a table-cell extend beyond the borders:
https://i.sstatic.net/FGjjg.png
Any advice on how to resolve this issue?
UPDATE: Check out the JSFiddle demo here: https://jsfiddle.net/3gcnaetx/1/