title: DataTables warning: table id=table_especie - Requested unknown parameter '0' for row 0, column 0
body: <p>I know this was asked hundreds of times, but I think my case is very specific and it needs someone who knows jQuery to help, or at least has seen this before!</p>
  
  <p>I have this code to build a table called "especie:</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;table class="table" id="table_especie"&gt;
       &lt;thead&gt;
        &lt;tr&gt;
         &lt;th&gt;&lt;/th&gt;
         &lt;th&gt;&lt;/th&gt;
        &lt;/tr&gt;
       &lt;/thead&gt;
       &lt;tbody&gt;
       &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Script JS:</p>
  
  <pre><code>var tableEspecie= $('#table_especie').DataTable({
      "paging":   false,
      "info":     false,
      "order": [
          [2, "asc" ],
          [3, "asc"],
          [1, "asc"]
      ],
      "columnDefs": [
          { "visible": false, "targets": 0 },
          { "visible": false, "targets": 2 },
          { "visible": false, "targets": 3 }
      ],
  
      "drawCallback": function () {
          var api = this.api();
          var rows = api.rows( {page:'current'} ).nodes();
          var last=null;
  
          api.column(2, {page:'current'} ).data().each( function ( especie, i ) {
              if ( last !== especie) {
                  $(rows).eq( i ).before(
                      '&lt;tr class="especie info"&gt;&lt;td colspan="4"&gt;'+especie+'&lt;/td&gt;&lt;/tr&gt;'
                  );
  
                  last = especie;
              }
          } );
  
          $("#table_especie thead").remove();
          $("#table_especie tfoot").remove();
      }
  });
  
  var populateEspecieShowName = function(data) {
      $('#animal_especie_name').text(data[0].name);
  };
  
  
  var populateEspecieTable = function(data) {
      var animais = [];
  
      $.each(data, function(id_animal, animal){
          animais.push([
              animal.id_animal,
              animal.nome_animal + ': ' + '&lt;br&gt;' + animal.notas_animal,
              animal.foto_animal
          ]);
      });
  
      $('#table_especie').dataTable().fnClearTable();
      $('#table_especie').dataTable().fnAddData(animais);
      $('#table_especie').dataTable().fnDraw();
  };
  
  $('#table_especie tbody').on( 'click', 'tr', function () {
      var animalId = $('#table_especie').DataTable().row(this).data();
  
      if (animalId !== undefined)
          $.route('animal/' + animalId[0]);
  });
  
  $('#table_especie_search').keyup(function(){
      $('#table_especie').DataTable().search($(this).val(), false, true).draw() ;
  });
  </code></pre>
  
  <p>Basically, it builds the table using data from a database! And I get the error (DataTables warning: table id=table_especie - Requested unknown parameter '0' for row 0, column 0. For more information about this error, please see <a href="http://datatables.net/tn/4" rel="nofollow noreferrer">http://datatables.net/tn/4</a>) every time I go from table "especies" to table "especie". The error makes it sound like it's something wrong with "especie". What should I change to make the error go away? It still builds the table, but I get this error before. Thanks!!!</p>