How can a cell in a table have a margin? Think about it.
A table is a spreadsheet of rows and columns so how can one cell have a margin? It would no longer be rows and columns. Margin does not apply to cells and is not needed ever.
The margin on the cell has no effect so why use it?
Just use flex code I gave you before and the inputs will line up nicely (answer to question in one of your multiple threads on the same subject) and the whitespace will disappear and the code is less.
When you apply display:flex to a parent then it immediately makes all direct children ‘flex-items’ and as flex-items they have specific block behaviours and white-space nodes are ignored (among its other behaviours).
Display table and table-cell do not change the behaviour of its direct descendants (although there may be some differences).
If you are talking about the red background then that’s a red background on the parent.
I you wanted the red background as shrink-to-fit then you would use display:inline-flx on the parent.
You can’t keep pulling code out of one demo and then creating a completely different scenario and then expect it to behave the same. The original code was perfect for the original demo.
Yes I mentioned the different behaviours between different display types. Some will collapse margins and others won’t. Display:flex and display:inline-flex are different properties with different behaviours.
Get rid of the body margins and there will be no discrepancy.