title: Display multiplication table from 2 to 12 in C#, WPF format
body: <p>I need to write a program that asks the user for a number from 2 to 12, and then displays a multiplication table with answers in the format below:</p>
  
  <p>User enters: 6
  Output:</p>
  
  <pre><code>     2    3    4    5    6 
  
  2    4    6    8    10   12
  
  3    6    9    12   15   18
  
  4    8    12   16   20   24
  
  5    10   15   20   25   30
  
  6    12   18   24   30   36
  </code></pre>
  
  <p>I cannot get, neither the top horizontal row (2, 3, 4, 5, 6), nor the left column (2, 3, 4, 5, 6) to display on the WPF application screen, and I also need to get the vertical tab right, so all the numbers are equally spaced horizontally and vertically. My current code looks like this:</p>
  
  <pre><code>    int inputNumber;
  
      public MainWindow()
      {
          InitializeComponent();
          btnYes.IsEnabled = false;
      }
  
      private void calculateTable_Click(object sender, RoutedEventArgs e)
      {
          inputNumber = int.Parse(number.Text);
          if (inputNumber &lt; 2 || inputNumber &gt; 12)
          {
              MessageBox.Show("Please enter values between 2 and 12");
              number.Clear();
              return;
          }
          for (int i = 2; i &lt;= inputNumber; i++)
          {
              for (int j = 2; j &lt;= inputNumber; j++)
              {
                  displayValues.Text += (i * j).ToString() + '\t';
              }
              displayValues.Text += '\n';
          }
          calculateTable.IsEnabled = false;
          btnYes.IsEnabled = true;
      }
  
      private void btnYes_Click(object sender, RoutedEventArgs e)
      {
          number.Clear();
          number.Focus();
          displayValues.Text = String.Empty;
          btnYes.IsEnabled = false;
          calculateTable.IsEnabled = true;
      }
  
      private void btnNo_Click(object sender, RoutedEventArgs e)
      {
          this.Close();
      }
  </code></pre>