title: append li to table td using javascript/jquery
body: <p>I want to append ul ol to td, i tried for a few tags h3, it's working but I do the same for ul ol the data is mismatching within table format, as I am new to javascript any help would be appreciated. Thank you in advance. Below is my code. Also, I'm unable to add the library version in the snippet. Please help</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 h2data = document.getElementsByClassName('carname');
      var title_array=[];
      for(var i=0; i&lt; h2data.length; i++){
      title_array.push(h2data[i].innerText);
         
      }
       console.log(title_array);
       
      var pdata_detail = document.getElementsByClassName('car_details');
      var pdata_array=[];
      for(var i=0; i&lt; pdata_detail.length; i++){
      pdata_array.push(pdata_detail[i].innerText);
         
      }
       console.log(pdata_array);  
  
      var dscdata = document.getElementsByClassName('features');
      var desc_array=[];
      for(var i=0; i&lt; dscdata.length; i++){
      desc_array.push(dscdata[i].innerText);
         
      }
       console.log(desc_array); 
  
       
      var soldes = document.getElementsByClassName('feature_detail');
      var soldetail_array=[];
      for(var i=0; i&lt; soldes.length; i++){
      soldetail_array.push(soldes[i].innerText);
         
      }
       console.log(soldetail_array);</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;h1&gt;List of cars&lt;/h1&gt;
          &lt;h2 class="carname"&gt;BMW&lt;/h2&gt;
          &lt;h3 class="car_details"&gt;Manuf Details&lt;/h3&gt;        
          &lt;ul&gt;
              &lt;li&gt;
                  &lt;p&gt;Top 10 Most Popular Car Features &lt;/p&gt;
              &lt;/li&gt;
              &lt;li&gt;
                  &lt;p&gt;Touchscreen infotainment system &lt;/p&gt;
              &lt;/li&gt;
              &lt;li&gt;
                  &lt;p&gt;Music System.&lt;/p&gt;
              &lt;/li&gt;
              &lt;li&gt;
                  &lt;p&gt;Panoramic Sunroof.&lt;/p&gt;
              &lt;/li&gt;
              &lt;li&gt;
                  &lt;p&gt;Music System&lt;/p&gt;
              &lt;/li&gt;
              &lt;li&gt;
                  &lt;p&gt;LED DRLs.&lt;/p&gt;
              &lt;/li&gt;            
          &lt;/ul&gt;
          &lt;h3 class="features"&gt;good features:&lt;/h3&gt;
          &lt;p class="feature_detail"&gt;Fast USB Charging Outlets &amp; Wireless Charger.&lt;/p&gt;
          
          
          &lt;h2 class="carname"&gt;Brimstone&lt;/h2&gt;
          &lt;h3 class="car_details"&gt;Manuf Details:&lt;/h3&gt;        
          &lt;ul&gt;
              &lt;li&gt;
                  &lt;p&gt;Front Bumper&lt;/p&gt;
              &lt;/li&gt;
              &lt;li&gt;
                  &lt;p&gt;Fender&lt;/p&gt;
              &lt;/li&gt;
          &lt;/ul&gt;
          &lt;h3&gt; Areas:&lt;/h3&gt;
          &lt;ul&gt;
              &lt;li&gt;
                  &lt;p&gt;Rear Bumper&lt;/p&gt;
              &lt;/li&gt;
              &lt;li&gt;
                  &lt;p&gt;Grille&lt;/p&gt;
              &lt;/li&gt;
          &lt;/ul&gt;
          
          
          &lt;h2 class="carname"&gt;Smoke&lt;/h2&gt;
          &lt;h3 class="car_details"&gt;Manuf Details&lt;/h3&gt;
          &lt;p class=""&gt;dec 2021&lt;/p&gt;
          &lt;ol start="1"&gt;
              &lt;li&gt;
                  &lt;p&gt;The darkest of smokes emitted from the exhaust &lt;/p&gt;
              &lt;/li&gt;
              &lt;li&gt;
                  &lt;p&gt;The spark at ignition can only combust a certain amount&lt;/p&gt;
              &lt;/li&gt;
              &lt;li&gt;
                  &lt;p&gt;conditions can be caused by a leaking fuel injector&lt;/p&gt;
              &lt;/li&gt;
              &lt;li&gt;
                  &lt;p&gt;only will this constrict the volume of air&lt;/p&gt;
              &lt;/li&gt;
              
              &lt;li&gt;
                  &lt;p&gt;Blueish hue can be found from cars&lt;/p&gt;
              &lt;/li&gt;
          &lt;/ol&gt;
          &lt;p&gt;Head gasket failure types:&lt;/p&gt;
          &lt;ol start="1"&gt;
              &lt;li&gt;
                  &lt;p&gt;Compression leaks to crankcase smoking &lt;/p&gt;
              &lt;/li&gt;
              &lt;li&gt;
                  &lt;p&gt;Blown to outside oil leak&lt;/p&gt;
              &lt;/li&gt;
              &lt;li&gt;
                  &lt;p&gt;Blown to outside coolant leak.&lt;/p&gt;
              &lt;/li&gt;
              &lt;li&gt;
                  &lt;p&gt;Compression leak to coolant overheating.&lt;/p&gt;
              &lt;/li&gt;            
          &lt;/ol&gt;
          &lt;h3 class="features"&gt;good Feature:&lt;/h3&gt;
          &lt;p class="feature_detail"&gt;Exhaust products that make it to the outside world can vary in colour,. &lt;/p&gt;
          
          &lt;button onclick="addTable()"&gt;Click me&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>