protected void addLayoutColumns(Layout layout, JSONArray columnsJSONArray) throws Exception {

    if (columnsJSONArray == null) {
      return;
    }

    for (int i = 0; i < columnsJSONArray.length(); i++) {
      JSONArray columnJSONArray = columnsJSONArray.getJSONArray(i);

      addLayoutColumn(layout, "column-" + (i + 1), columnJSONArray);
    }
  }
  private static String toHTMLTable(
      JSONArray json, JSONArray columns, int limit, String tableId, String tableClass) {
    if ((json == null) || (json.length() <= 0)) {
      return (null);
    }

    // Check for objects or arrays
    if (json.getJSONObject(0) != null) {
      return (SQLRenderUtil.toHTMLTable(json, limit, tableId, tableClass));
    } else if (json.getJSONArray(0) != null) {
      return (SQLRenderUtil.toHTMLTable(json, toJSONTitles(columns), limit, tableId, tableClass));
    }
    return (null);
  }