public static void Main()
int tableSize, rowStart, columnStart, multiply;
Console.WriteLine("Times Table Generator");
Console.WriteLine("Please enter the size of the table:");
tableSize = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Please enter a number greater then 0");
Console.Write("{0,7}","x ");
for (columnStart=1; columnStart<=tableSize; columnStart++) {
Console.Write("{0,7}",columnStart);
Console.WriteLine(new string('_',(7*tableSize)+7));
for (rowStart = 1; rowStart<=tableSize; rowStart++) {
Console.Write("{0,7}",rowStart+"|");
for (multiply = 1; multiply<=tableSize; multiply++) {
Console.Write("{0,7}",multiply*rowStart);