Check the length of the column value, and also keep the length of the value for the format.
printf(" %-4s| %-10s| %-5s|\n", "ID", "NAME", "AGE");
See how the MySQL shell interface was designed, this will give you a good idea.
Vijay kumar kanta
source share