private String getRowLineBuf ( int colCount , List < Integer > colMaxLenList , String [ ] [ ] data ) { S . Buffer rowBuilder = S . buffer ( ) ; int colWidth ; for ( int i = 0 ; i < colCount ; i ++ ) { colWidth = colMaxLenList . get ( i ) + 3 ; for ( int j = 0 ; j < colWidth ; j ++ ) { if ( j == 0 ) { rowBuilder . append ( "+" ) ; } else if ( ( i + 1 == colCount && j + 1 == colWidth ) ) { //for last column close the border rowBuilder . append ( "-+" ) ; } else { rowBuilder . append ( "-" ) ; } } } return rowBuilder . append ( "\n" ) . toString ( ) ; }
Each string item rendering requires the border and a space on both sides .