title: How to make table with nested loop in JS
body: <p>How to make the middle Column to be X rather than 0.</p>
  
  <p>Here is my code:</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 table = document.createElement('table'), tr, td, row, cell;
  for (row = 0; row &lt; 3; row++) {
      tr = document.createElement('tr');
      for (cell = 0; cell &lt; 3; cell++) {
          td = document.createElement('td');
          tr.appendChild(td);
          td.innerHTML = 0 
      }
      table.appendChild(tr);
  }
  document.getElementById('container').appendChild(table);</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="container"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>