code: static String pad(final String data, final char doPadWithThis, final int totalWidth, final Alignment orientation) {
  
          final String pad = repeat(new String(new char[]{doPadWithThis}), Math.max(0, totalWidth - data.length()));
          String returnVal = "";
          if (orientation == null) {
              returnVal = data + pad;
          } else {
              switch (orientation) {
                  case Center:
                      returnVal = pad.substring(0, pad.length() / 2) + data + pad.substring(pad.length() / 2, pad.length());
                      break;
                  case Right:
                      returnVal = pad + data;
                      break;
                  default:
                      returnVal = data + pad;
  
              }
          }
          return returnVal;
      }
docs: This method fills one char either on the right site of a given string or on the left site or on both sites. Refer
  to the example below.
  <p/>
  <pre>
  pad (&quot;hello&quot;,'-',11,NiceTable.LEFT);
  results in &quot;hello------&quot;
  pad(&quot;hello&quot;,'/',11,NiceTable.RIGHT);
  results in &quot;//////hello&quot;;
  pad(&quot;hello&quot;,'.',11,NiceTable.CENTER);
  results in &quot;...hello...&quot;
  </pre>
  
  @param doPadWithThis the string to pad the string with
  @param data          the data to pad
  @param orientation   which orientation to take
  @param totalWidth    the total width of the result string
  @return padded string