title: How to add column in the javascript
body: <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>    function answer(){
              var u='';
              var num1 = document.getElementById('num1').value;
              var total = num1 * num1;
              for(var x=1; x&lt;=num1;x++){
                  u=u+x;
                  for(var y = u ; y&lt;=num1; y++){
                  }
              }
              console.log(u);
          }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;input type="text" id="num1" name=""&gt;
      &lt;button type="submit" onclick="answer()"&gt;Answer&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>Help how to add a column using for loop  Sorry guys I disturbed you</p>
  <p>My example problem if the user input 3 the output becomes</p>
  <pre><code>1 2 3 
  4 5 6
  7 8 9
  </code></pre>