We the box collapses, you should have your elements STACKED inside one container. When stacked, my database elements that are collapsed due to no data, are removed as well as the margins related to it. This should do the trick for you.
Just make sure we all get a way back home too.
I hope this helps.