Well lets get to it then so that we can move on to something else that might prove to be more interesting.
The first step that came to mind is to make a module that will be used to create an array of cell objects. Each cell will have an x and y position as well as an index value, this information can then be used later for the purpose of formating. So then this module will have just one public method that is used to create an array of these cells, and then that array is what will then be passed to another method that is used to render it.
In the body of the pubic method I have a forN option that is a method that will be called for each cell in the array. The default value for this will be a method that will set a n property for each cell that is the value of cell.x multiplied by cell.y.
So then once I have my module worked out that creates the array of cells that will contain the numbers for each value in the multiplication table, I then need a method that will be used to render that is html. Now this is something that will differ depending on the environment. For example in a nodejs environment I might want to create an html string, however in a client system I might want to use methods the document create element, and append child methods.
So here is the example again, but now in a node js module. The module exports property is what I am using to define what will be returned to another script when this is used in another script with require.
Now to use the module to create a table, and to render the table somehow. In this example I am just logging to the standard output of the console by way of the console log method. There is another way of going about doing this in nodejs that allows for a greater deal of control, but maybe that is a but off topic.
Then there is of course nodje and all the various ways to go about display g the data in that kind of environment when it comes to output the state of the table as standard output, writing a file, sending it over http to some server, and so on.