public static String toTable(ArrayList<ArrayList<String>> array, boolean header){
        
        //=====================  Local Data  ======================//
        final int COL_DIVIDE_WIDTH = 8;
        StringBuilder msg = new StringBuilder();
        
        //create array to hold column formatting information
        String[] colFormats = new String[array.get(0).size()];
        int[] maxLengths = new int[array.get(0).size()];
        
        //initialize maxLengths
        for(int i = 0; i < maxLengths.length; i++){
            maxLengths[i] = 0;
        }
        
        //find length of longest string in each column and set formatting
        //information accordingly
        for(List<String> row : array){
            for(int col = 0; col < array.get(0).size(); col++){
                int length = row.get(col).length();
                if(maxLengths[col] <= length){
                    maxLengths[col] = length;
                    colFormats[col] = "%-" + (length + COL_DIVIDE_WIDTH) + "s";
                }
            }        
        }
        
        //initialize message
        msg.append(CFormat.NL).append(CFormat.NL);
        
        //create set of dashes and insert into array if first
        //row is supposed to be the header row
        if(header){
            ArrayList<String> dashes = new ArrayList<>();
            for(int i = 0; i < array.get(0).size(); i++){
                dashes.add(addDashes("", maxLengths[i]));
            }
            array.add(1, dashes);
        }
        
        //add each row to the msg
        StringBuilder sb = new StringBuilder();
        Formatter frm = new Formatter(sb);
        for(int row = 0; row < array.size(); row++){
            //System.out.println(array.get(0).size());
            for(int col = 0; col < array.get(0).size(); col++){
                frm.format(colFormats[col], array.get(row).get(col));
            }
            sb.append(CFormat.NL);
        }
        
        msg.append(sb.toString());
        return msg.toString();
        
    }