title: Why I am having this type of error "TypeError: oColumn is undefined" using jquery datatables I followed all from its docs
body: <p>Why I am having this type of error "TypeError: oColumn is undefined" using jquery datatables I followed all instructions from its docs. I dont know what is wrong?</p>
  
  <p>Here's  the firebug's error output:</p>
  
  <p><img src="https://i.stack.imgur.com/ZTX1j.png" alt="enter image description here"></p>
  
  <p>Here's my html table structure:</p>
  
  <p><img src="https://i.stack.imgur.com/64a7E.png" alt="enter image description here"></p>
  
  <p>And here's the jquery code I use:</p>
  
  <pre><code>&lt;style type="text/css" title="currentStyle"&gt;
      @import "datatables/media/css/demo_table.css";
  &lt;/style&gt;
  &lt;script src="datatables/media/js/jquery.dataTables.js"&gt;&lt;/script&gt;
  &lt;script&gt;
      $(document).ready(function() {
              $('#products-result').dataTable( {
                  "sDom": "&lt;'row'&lt;'span6'l&gt;&lt;'span6'f&gt;r&gt;t&lt;'row'&lt;'span6'i&gt;&lt;'span6'p&gt;&gt;"
              } );
              $.extend( $.fn.dataTableExt.oStdClasses, {
              "sWrapper": "dataTables_wrapper form-inline"
          } );
      } );
  &lt;/script&gt;
  </code></pre>
  
  <p>table generated by jquery:</p>
  
  <pre><code>$.ajax({
          url: 'get-products.php',
          type: 'post',
          datatype: 'json',
          data: { category: $('.category').val().trim(), keyword: $('.keyword').val().trim() },
          beforeSend: fnLoadStart,
          complete: fnLoadStop,
          success: function(data){
              var toAppend = '';
  
              toAppend += '&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Image&lt;/th&gt;&lt;th&gt;Price&lt;/th&gt;&lt;th&gt;Shipping&lt;/th&gt;&lt;th&gt;Weight&lt;/th&gt;&lt;th&gt;Dimension&lt;/th&gt;&lt;th&gt;ASIN&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;th&gt;Reviews&lt;/th&gt;&lt;th&gt;Category&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;';
              toAppend += '&lt;tbody&gt;';
  
              if(typeof data === "object"){
                  for(var i=0;i&lt;data.length;i++){
  
                      var price = '';
                      if(data[i]['price'] === null){
                          price = 'No Price Available';
                      }
                      else {
                          price = data[i]['price'][0];
                      }
                      var img = '';
                      if(data[i]['image'] === null){
                          img = '&lt;img class="no-image" src="no-image.jpg" alt=""&gt;';
                      }
                      else {
                          img = '&lt;img src="'+data[i]['image'][0]+'" alt=""&gt;';
                      }
                      var description = '';
                      if(data[i]['product_description'] == 'Not Available'){
                          description = data[i]['product_description'];
                      }
                      else {
                          description = data[i]['product_description'][0];
                      }
  
                      toAppend += 
                      '&lt;tr&gt;&lt;td&gt;&lt;p&gt;'+
                      data[i]['product_name'][0]+'&lt;/p&gt;&lt;/td&gt;&lt;td&gt;'+
                      img+'&lt;/td&gt;&lt;td&gt;'+
                      price+'&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;&lt;span&gt;Standard: &lt;/span&gt;'+
                      data[i]['standard_shipping']+'&lt;/li&gt;&lt;li&gt;&lt;span&gt;Expedited: &lt;/span&gt;'+
                      data[i]['expedited_shipping']+'&lt;/li&gt;&lt;li&gt;&lt;span&gt;Two-day: &lt;/span&gt;'+
                      data[i]['twoday_shipping']+'&lt;/li&gt;&lt;li&gt;&lt;span&gt;One-day: &lt;/span&gt;'+
                      data[i]['oneday_shipping']+'&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td&gt;'+
                      data[i]['weight']+'&lt;/td&gt;&lt;td&gt;'+
                      data[i]['dimension']+'&lt;/td&gt;&lt;td&gt;'+
                      data[i]['asin'][0]+'&lt;/td&gt;&lt;td&gt;&lt;p&gt;'+
                      description+'&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;iframe src="'+
                      data[i]['reviews'][0]+'"&gt;&lt;/iframe&gt;&lt;/td&gt;&lt;td&gt;'+
                      data[i]['category'][0]+'&lt;/td&gt;&lt;/tr&gt;';
                  }
  
                  toAppend += '&lt;/tbody&gt;';
  
                  $('.data-results').append(toAppend);
              }
          }
      });
  </code></pre>
  
  <p>The HTML table</p>
  
  <pre><code>&lt;div&gt;
      &lt;table id="products-result" class="display data-results table table-striped table-hover table-bordered"&gt;
  
      &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Browser View Source:</p>
  
  <pre><code>    &lt;!DOCTYPE HTML&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;Products&lt;/title&gt;
      &lt;link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"&gt;
      &lt;link href="css/style.css" rel="stylesheet" type="text/css"&gt;
      &lt;script src="js/main.js"&gt;&lt;/script&gt;
      &lt;script src="js/search.js"&gt;&lt;/script&gt;
  
      &lt;style type="text/css" title="currentStyle"&gt;
          @import "datatables/media/css/demo_table.css";
      &lt;/style&gt;
      &lt;script src="datatables/media/js/jquery.dataTables.js"&gt;&lt;/script&gt;
      &lt;script&gt;
          $(document).ready(function() {
                  $('#products-result').dataTable( {
                      "sDom": "&lt;'row'&lt;'span6'l&gt;&lt;'span6'f&gt;r&gt;t&lt;'row'&lt;'span6'i&gt;&lt;'span6'p&gt;&gt;"
                  } );
                  $.extend( $.fn.dataTableExt.oStdClasses, {
                  "sWrapper": "dataTables_wrapper form-inline"
              } );
          } );
      &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;div&gt;
  
      &lt;div class="span7"&gt;
          &lt;form class="form-inline"&gt;
              &lt;select class="category"&gt;x
                  &lt;option&gt;All&lt;/option&gt;
                  &lt;option&gt;Apparel&lt;/option&gt;
                  &lt;option&gt;Appliances&lt;/option&gt;
                  &lt;option&gt;ArtsAndCrafts&lt;/option&gt;
                  &lt;option&gt;Automotive&lt;/option&gt;
                  &lt;option&gt;Baby&lt;/option&gt;
                  &lt;option&gt;Beauty&lt;/option&gt;
                  &lt;option&gt;Blended&lt;/option&gt;
                  &lt;option&gt;Books&lt;/option&gt;
                  &lt;option&gt;Classical&lt;/option&gt;
                  &lt;option&gt;Collectibles&lt;/option&gt;
                  &lt;option&gt;DVD&lt;/option&gt;
                  &lt;option&gt;DigitalMusic&lt;/option&gt;
                  &lt;option&gt;Electronics&lt;/option&gt;
                  &lt;option&gt;GiftCards&lt;/option&gt;
                  &lt;option&gt;GourmetFood&lt;/option&gt;
                  &lt;option&gt;Grocery&lt;/option&gt;
                  &lt;option&gt;HealthPersonalCare&lt;/option&gt;
                  &lt;option&gt;HomeGarden&lt;/option&gt;
                  &lt;option&gt;Industrial&lt;/option&gt;
                  &lt;option&gt;Jewelry&lt;/option&gt;
                  &lt;option&gt;KindleStore&lt;/option&gt;
                  &lt;option&gt;Kitchen&lt;/option&gt;
                  &lt;option&gt;LawnAndGarden&lt;/option&gt;
                  &lt;option&gt;Marketplace&lt;/option&gt;
                  &lt;option&gt;MP3Downloads&lt;/option&gt;
                  &lt;option&gt;Magazines&lt;/option&gt;
                  &lt;option&gt;Miscellaneous&lt;/option&gt;
                  &lt;option&gt;Music&lt;/option&gt;
                  &lt;option&gt;MusicTracks&lt;/option&gt;
                  &lt;option&gt;MusicalInstruments&lt;/option&gt;
                  &lt;option&gt;MobileApps&lt;/option&gt;
                  &lt;option&gt;OfficeProducts&lt;/option&gt;
                  &lt;option&gt;OutdoorLiving&lt;/option&gt;
                  &lt;option&gt;PCHardware&lt;/option&gt;
                  &lt;option&gt;PetSupplies&lt;/option&gt;
                  &lt;option&gt;Photo&lt;/option&gt;
                  &lt;option&gt;Shoes&lt;/option&gt;
                  &lt;option&gt;Software&lt;/option&gt;
                  &lt;option&gt;SportingGoods&lt;/option&gt;
                  &lt;option&gt;Tools&lt;/option&gt;
                  &lt;option&gt;Toys&lt;/option&gt;
                  &lt;option&gt;UnboxVideo&lt;/option&gt;
                  &lt;option&gt;VHS&lt;/option&gt;
                  &lt;option&gt;Video&lt;/option&gt;
                  &lt;option&gt;VideoGames&lt;/option&gt;
                  &lt;option&gt;Watches&lt;/option&gt;
                  &lt;option&gt;Wireless&lt;/option&gt;
                  &lt;option&gt;WirelessAccessories&lt;/option&gt;
              &lt;/select&gt;
              &lt;input class="keyword" type="text" placeholder="Keyword"&gt;
              &lt;input type="button" class="btnresult btn" value="Generate"&gt;
          &lt;/form&gt;
      &lt;/div&gt;
  
      &lt;div id="ajaxLoader"&gt;
          &lt;img src="loading.gif" alt=""&gt;
      &lt;/div&gt;
  
      &lt;div&gt;
          &lt;table id="products-result" class="display data-results table table-striped table-hover table-bordered"&gt;
  
          &lt;/table&gt;
      &lt;/div&gt;
  
  &lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>