Hello,
Can anyone show me how to set width between character in java. I'm looking for something like this.
Items NumOfItems Price
A 2 $10
B 1 $5
When I use the for loop to make something like the table above it shows something like this.
Items NumOf Items Price
A 2 $10
B 1 $5
They are scattered the way I don't wait them to be.
How do I fix that.? Here is my simple code.
for(int i = 0; i < ITEM; i++){
int[] sold = {10, 10, 10, 10, 10, 10, 10, 10, 10};
System.out.println(i+1 +"."+ items[i] +"\t\t\t\t"+ +count[i]+"("+(sold[i] - count[i])+")" + "\t\t\t" +
"$"+(df.format((sold[i]-count[i])*price[i])));
}