Seems more or less impossible to do column by column rendering due to the structure of a html table..
I would rather focus on restructuring the data source for the table.
In java, you can use an ArrayList<HashMap<String, String>> as container for the data.
In SSJS, you can use an array of objects.
Put null or empty string for the columns that doesn't have data in the row.
When you have the data in this structure, you can use a data table.