Datatables is not getting enabled to the table. Please verify code.
Datatables is not getting enabled to the table. Please verify code.
kd1989
Posts: 2Questions: 1Answers: 0
I'm saving below code in a local .html file and load it into browser, but datatables is not getting applied. Please help.
...
<head>
<link rel="stylesheet" href="http://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css">
<
script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"</script>
$(document).ready(function(){ $('#example').DataTable(); });</head>
<body>
Name | Position | Office | Age | Start date | Salary |
---|---|---|---|---|---|
Name | Position | Office | Age | Start date | Salary |
Tiger Nixon | System Architect | Edinburgh | 61 | 2011/04/25 | $320,800 |
Garrett Winters | Accountant | Tokyo | 63 | 2011/07/25 | $170,750 |
</body>
...
This discussion has been closed.
Answers
First, please don't post your questions twice:
https://datatables.net/forums/discussion/41356/jquery-datatable-plugin-not-working-in-html-table#latest
It looks like you are not loading jQuery. Please see this page for more details:
https://datatables.net/manual/installation
You can look at this basic example to see what is needed:
https://datatables.net/examples/basic_init/zero_configuration.html
The easiest way to get the files you need is to use the download builder:
https://datatables.net/download/index
Kevin