Tell me how to display a table in the console. For example, you need to display the table of Pythagoras. Picture below

enter image description here

The main requirement is to keep the formatting and make the first cell empty.

  • The link here is broken. - nick_n_a
  • 1. Save formatting - each number is finished with spaces to a fixed width. 2. For the first cell to be empty, output spaces there. - Yaant
  • Thank you, corrected - Dimon Kachurinets
  • If this is tabular data, then it may be more convenient to display it in Console.table() - Sergey Glazirin

1 answer 1

The first 3x3, then by analogy.

 console.table([[4, 6, 8], [6, 9, 12], [8, 12, 16]]);