Jquery DataTable does not work

1

I created a table on my system using the jquery datatable library, but it is not working. At the end of the view I made the code declaration in javascript, however the style is not applied.

Follow the code below:

<script type="text/javascript">
    $(document).ready(function () {
     $('.table').dataTable({
            "order": [[1, "asc"]]
        });
    });
</script>

E css:

<link href="@Url.Content("~/content/DataTables/css/datatables.bootstrap.css")" rel="stylesheet" />

Note: I use 3 datatables, only one does not work and the code is identical for all 3 cases.

    
asked by anonymous 30.07.2017 / 04:58

1 answer

1

The error can be in the html of the table. If it is not correct (table,thead,tbody) it can happen not to initialize properly.

    
20.10.2017 / 16:04