code: protected void appendWithAlignment(Appendable appendable, ColumnState state, boolean doIndentThisLine, CellBuffer cellBuffer) throws IOException {
  
      int space = cellBuffer.getRest();
      assert (space >= 0);
      TextColumnInfo columnInfo = state.getColumnInfo();
      switch (columnInfo.getAlignment()) {
        case LEFT:
          if (doIndentThisLine) {
            appendable.append(columnInfo.getIndent());
          }
          appendable.append(cellBuffer.buffer);
          fill(appendable, columnInfo.getFiller(), space);
          break;
        case RIGHT:
          fill(appendable, columnInfo.getFiller(), space);
          appendable.append(cellBuffer.buffer);
          if (doIndentThisLine) {
            appendable.append(columnInfo.getIndent());
          }
          break;
        case CENTER:
          int leftSpace = space / 2;
          int rightSpace = space - leftSpace;
          fill(appendable, columnInfo.getFiller(), leftSpace);
          String rightIndent = "";
          if (doIndentThisLine) {
            String indent = columnInfo.getIndent();
            int indentLength = indent.length();
            int rightIndex = indentLength - (indentLength / 2);
            String leftIndent = indent.substring(0, rightIndex);
            rightIndent = indent.substring(rightIndex);
            appendable.append(leftIndent);
          }
          appendable.append(cellBuffer.buffer);
          if (doIndentThisLine) {
            appendable.append(rightIndent);
          }
          fill(appendable, columnInfo.getFiller(), rightSpace);
          break;
        default :
          throw new IllegalStateException("" + columnInfo.getAlignment());
      }
    }
docs: This method actually appends the text for a single line of a single column according to
  {@link TextColumnInfo#getAlignment() alignment}.
  
  @param appendable is where to append to.
  @param state is the current {@link ColumnState}.
  @param doIndentThisLine - {@code true} if the current cell should be {@link TextColumnInfo#getIndent()
  indented}, {@code false} otherwise.
  @param cellBuffer is the text to align and append.
  @throws IOException if throw by the {@link Appendable}.