How can I align it properly?
got hard time. sorry i'm just new in Java
public class MultiplicationTable {
public static void main(String[] args) {
int[][] multtable = new int[11][11];
System.out.print("*");
for (int a=1;a<=10;a++)
{
System.out.print("\t"+a) ;
}
System.out.println(" ");
for(int i=0; i<=10; i++) { // this loop is for rows
for(int j=0; j<=10; j++) { // this loop is for columns
multtable[i][j] = i*j;
}
}
System.out.print("\t");
System.out.print("------------------------------------------------------------------");
System.out.println("");
for(int i=1; i<11; i++) {
System.out.print(i+"|\t");
for(int j=1; j<11; j++) {
// this ensures that all single-digit numbers will line up into columns
System.out.print(multtable[i][j]+"\t");
}
// make a new line for every row
System.out.print("\n");
}
}
}