What is the best way to print array cells String[][]as a right-aligned table? For example, input
{ { "x", "xxx" }, { "yyy", "y" }, { "zz", "zz" } }
should output
x xxx
yyy y
zz zz
This is similar to what can be done with java.util.Formatter, but does not seem to allow the use of a variable field width. A better answer would be to use the standard method to fill in the cells of a table rather than manually insert spaces.
source
share