The layout needed here can probably be accomplished more cleanly without tables, BUT I realize that you were probably building off of pre-existing examples that do this. It's fine for now but we should revisit after DML.