if (table != null) {
final PArray oldTableRows = table.optArray("data", new PJsonArray(table, new JSONArray(), "data"));
for (int i = 0; i < oldTableRows.size(); i++) {
final PObject oldRow = oldTableRows.getObject(i);
if (!oldRow.keys().hasNext()) {
// row is empty, skip
continue;
}
// copy the values for each column