restructure json for non-default style tables with headers in first column