Java tutorial
import java.io.Console; public class Main { public static void main(String[] args) throws Exception { Console cnsl = System.console(); if (cnsl != null) { String fmt = "%1$4s %2$10s %3$10s%n"; // format cnsl.printf(fmt, "Items", "Quanity", "Price"); cnsl.printf(fmt, "-----", "-----", "-----"); cnsl.printf(fmt, "PHP", "1Kg", "15"); cnsl.printf(fmt, "CSS", "2Kg", "50"); cnsl.printf(fmt, "Java", "3Kg", "30"); cnsl.printf(fmt, "HTML", "4Kg", "80"); } } }