display pyramid in javascript in the below format
<p>I am trying to display the pyramid in the console part using only javascript except document.write("")</p>

<pre><code> *                                                       
 * *                                                              
 * * *                                                      
 * * * *                                                     
 * * * * *
</code></pre>

<p>I don't want in the  above format.
I want in the below format </p>

<pre><code>    *                                                       
   * *                                                              
  * * *                                                      
 * * * *                                                     
* * * * *
</code></pre>

<p>My code is</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>function getPyramid(param) {

  
      for (var i = 1; i &lt;= param; i++) {
var output = "";
        for (var j = 1; j &lt;= i; j++) {
          output += j + "     ";
        }
        console.log(output);
        output = "";
      }

    }</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;button onclick="getPyramid('10')"&gt;</code></pre>
</div>
</div>
</p>