code: private static String getColGroup(String formatString, String delimiter) {
  
          StringBuffer colgroup = new StringBuffer(128);
          String[] formatStrings = formatString.split(delimiter);
          colgroup.append("<colgroup>");
          for (int i = 0; i < formatStrings.length; i++) {
              colgroup.append("<col align=\"");
              char align = formatStrings[i].trim().charAt(0);
              switch (align) {
                  case 'l':
                      colgroup.append("left");
                      break;
                  case 'c':
                      colgroup.append("center");
                      break;
                  case 'r':
                      colgroup.append("right");
                      break;
                  default:
                      throw new RuntimeException("invalid format option");
              }
              colgroup.append("\"/>");
          }
          return colgroup.append("</colgroup>").toString();
      }
docs: Converts a delimiter separated format string int o colgroup html fragment.<p>
  
  @param formatString the formatstring to convert
  @param delimiter the delimiter the formats (l,r or c) are delimited with
  
  @return the resulting colgroup HTML