title: Creating M*N table and export and download excel file with java script in html page
body: <p>Is there a way that the following script after creating the table (N * M) can finally receive and download Excel output from it. Of course, I mean without using Excel software DLLs.<br />
  The script for creating the table is as follows (Generates the script below the table but I do not know how to <strong>convert it to Excel</strong>.) :</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var rows = prompt("How many rows for your multiplication table?");
  var cols = prompt("How many columns for your multiplication table?");
  if (rows == "" || rows == null)
    rows = 10;
  if (cols == "" || cols == null)
    cols = 10;
  createTable(rows, cols);
  
  function createTable(rows, cols) {
    var j = 1;
    var output = "&lt;table border='1' width='500' cellspacing='0'cellpadding='5'&gt;";
    for (i = 1; i &lt;= rows; i++) {
      output = output + "&lt;tr&gt;";
      while (j &lt;= cols) {
        output = output + "&lt;td&gt;" + i * j + "&lt;/td&gt;";
        j = j + 1;
      }
      output = output + "&lt;/tr&gt;";
      j = 1;
    }
    output = output + "&lt;/table&gt;";
    document.write(output);
  }</code></pre>
  </div>
  </div>
  </p>