title: Two DataTables in one Page source Ajax request
body: <p>I have a page where I want to put two or more DataTables fetching data for Ajax. The problem that happens is that the first is filled DataTables but when trying to fill the second of the error message:</p>
  
  <p>DataTables warning: Attempted to initialise DataTables on a node which is not a table: DIV</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      var oTableSetor;
      var oTableEstoque;
  
      function dtConvFromJSON(data)
      {
          return data;
      }
  
      $(document).ready(function () {
          $('.dataTable').dataTable();
          GridProdutoLote();    
          GridProdutoEstoque();
      });
  
      function GridProdutoLote() {
          if (oTableSetor===undefined)
          {
              oTableGrid = $('#lista_lote').dataTable({           
                  "bServerSide": true,           
                  "sAjaxSource": '@Html.Raw(@Url.Action("ListaGenerica", "Home", new { aController = "ProdutoLote", filtroID = @Model.ProdutoID  } ))',
                  "bProcessing": true,
                  "sPaginationType": "full_numbers",                  
                  "aoColumns": [
                              { "mDataProp": "ProdutoLoteID", "sTitle": "ID"},
                              { "mDataProp": "Lote", "sTitle": "Lote" },
                              { "mDataProp": "Identificacao", "sTitle": "Identificação"},
                              { "mDataProp": "DtFabricacao", "sTitle": "Dt. Fabricação", "mRender": function (data, type, full) { return dtConvFromJSON(data); } },
                              { "mDataProp": "DtValidade", "sTitle": "Dt. Validade", "mRender": function (data, type, full) { return dtConvFromJSON(data); }},
                              { "mDataProp": "QtdeAtual", "sTitle": "Qtde. Atual"},
                              { "mDataProp": "QtdeEmUtilizacao", "sTitle": "Qtde. em Utilizacao"},                           
                              { "mData": null, "bSortable": false, "fnRender": function (o) {return '&lt;a class="icone_16x16_detalhe" href=/Setor/Detalhar/' + o.aData["ProdutoLoteID"] + '&gt;D&lt;/a&gt;';}}                         
                  ],
              });
          }
      };
  
  
      function GridProdutoEstoque() {
          if (oTableEstoque===undefined)
          {
              oTableEstoque = $('#grid_estoque').dataTable({           
                  "bServerSide": true,           
                  "sAjaxSource": '@Html.Raw(@Url.Action("ListaGenerica", "Home", new { aController = "ProdutoEstoque", filtroID = @Model.ProdutoID  } ))',
                  "bProcessing": true,
                  "sPaginationType": "full_numbers",                  
                  "aoColumns": [
                              { "mDataProp": "ProdutoEstoqueID", "sTitle": "ID"},                        
                              { "mDataProp": "Identificacao", "sTitle": "Identificação"},
                              { "mDataProp": "Lote", "sTitle": "Lote", "mRender": function (data, type, full) { return dtConvFromJSON(data); } },
                              { "mDataProp": "QtdeMinima", "sTitle": "QtdeMinima", "mRender": function (data, type, full) { return dtConvFromJSON(data); }},
                              { "mDataProp": "QtdeAtual", "sTitle": "Qtde. Atual"},
                              { "mDataProp": "QtdeEmUtilizacao", "sTitle": "Qtde. em Utilizacao"},                           
                              { "mData": null, "bSortable": false, "fnRender": function (o) {return '&lt;a class="icone_16x16_detalhe" href=/Setor/Detalhar/' + o.aData["ProdutoEstoqueID"] + '&gt;D&lt;/a&gt;';}}                         
                  ],
              });
          }
      };
  
  &lt;/script&gt;
  
  
  &lt;div class="linha left" id="grid_lote"&gt;   
      &lt;br /&gt;       
      &lt;br /&gt;
      &lt;table id="lista_lote" class="display"&gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;th&gt;&lt;/th&gt;
                  &lt;th&gt;&lt;/th&gt;
                  &lt;th&gt;&lt;/th&gt;
                  &lt;th&gt;&lt;/th&gt;               
                  &lt;th&gt;&lt;/th&gt;
                  &lt;th&gt;&lt;/th&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;
  &lt;/div&gt;
  
  &lt;div class="linha left" id="grid_estoque"&gt;   
      &lt;br /&gt;       
      &lt;br /&gt;
      &lt;table id="lista_estoque" class="display"&gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;th&gt;&lt;/th&gt;
                  &lt;th&gt;&lt;/th&gt;
                  &lt;th&gt;&lt;/th&gt;
                  &lt;th&gt;&lt;/th&gt;               
                  &lt;th&gt;&lt;/th&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;
  &lt;/div&gt;
  </code></pre>