protected void align(String[][] strings){
  int rows=strings.length;
  int columns=0;
  if (rows > 0)   columns=strings[0].length;
  int[] maxColWidth=new int[columns];
  int[] maxColLead=null;
  boolean isDecimal=alignment.equals(DECIMAL);
  if (isDecimal)   maxColLead=new int[columns];
  for (int column=0; column < columns; column++) {
    int maxWidth=minColumnWidth;
    int maxLead=Integer.MIN_VALUE;
    for (int row=0; row < rows; row++) {
      String s=strings[row][column];
      maxWidth=Math.max(maxWidth,s.length());
      if (isDecimal)       maxLead=Math.max(maxLead,lead(s));
    }
    maxColWidth[column]=maxWidth;
    if (isDecimal)     maxColLead[column]=maxLead;
  }
  for (int row=0; row < rows; row++) {
    alignRow(strings[row],maxColWidth,maxColLead);
  }
}

protected void align ( String [ ] [ ] strings ) { int rows = strings . length ; int columns = 0 ; if ( rows > 0 ) columns = strings [ 0 ] . length ; int [ ] maxColWidth = new int [ columns ] ; int [ ] maxColLead = null ; boolean isDecimal = alignment . equals ( DECIMAL ) ; if ( isDecimal ) maxColLead = new int [ columns ] ; for ( int column = 0 ; column < columns ; column ++ ) { int maxWidth = minColumnWidth ; int maxLead = Integer . MIN_VALUE ; for ( int row = 0 ; row < rows ; row ++ ) { String s = strings [ row ] [ column ] ; maxWidth = Math . max ( maxWidth , s . length ( ) ) ; if ( isDecimal ) maxLead = Math . max ( maxLead , lead ( s ) ) ; } maxColWidth [ column ] = maxWidth ; if ( isDecimal ) maxColLead [ column ] = maxLead ; } for ( int row = 0 ; row < rows ; row ++ ) { alignRow ( strings [ row ] , maxColWidth , maxColLead ) ; } }
modifies the strings in a column of the string matrix to be aligned ( left , centered , right , decimal ) .
