title: Formatting and printing a two-dimensional array (VB6)
body: <p>I need help here in a multiplication table program. The program asks the user through a text box the dimension of the two-dimensional array. When the dimension is retrieved, the program should print the multiplication table with the given dimension neatly in the form. The problem is, I do not know how to print the array neatly in a table format. It's something like this as a sample output:</p>
  
  <pre><code>1 2  3  4  5 
  2 4  6  8  10
  3 6  9  12 15
  4 8  12 16 20
  5 10 15 20 25
  </code></pre>
  
  <p>Here's my work. </p>
  
  <pre><code>Option Explicit
  
  Dim maxNum As Integer
  Dim multiplicationTable() As Integer
  Dim x As Integer
  Dim y As Integer
  
  Private Sub cmdDisplay_Click()
  
      cmdDisplay.Enabled = False
      maxNum = Val(txtDimension.Text)
  
      ReDim multiplicationTable(maxNum, maxNum) As Integer
  
      For y = 1 To maxNum
          For x = 1 To maxNum
              multiplicationTable(x, y) = x * y
          Next x
      Next y
  
  End Sub
  </code></pre>
  
  <p>What piece of code could make this program print the table neatly in the form?</p>