DataTable in partial view
问题 I have datatable in _layout that works fine all other tables except this particular one I have in a partial view perhaps because of the way the data is loaded. _layout.cshtml $('.dataTableList').DataTable({ responsive: true, "autoWidth": false }); Detail.cshtml <div class="inventory" data-url=@Url.Action("Inventory")>...</div> Load div table: $('.inventory').each(function (index, item) { var url = $(item).data("url"); if (url && url.length > 0) { $(item).load(url); } }); Controller-Action