- Import the css and js file from dist folder to your html or any templating engine:
<link rel="stylesheet" type="text/css" href="assets/dist/css/style.css"> <script type="text/javascript" src="assets/dist/js/script.min.js"></script>
- At the bottom. Create a script tag then write this:
window.addEventListener("load", function() { var ref = new datatable('table'); // this table string is from DOM tag. ref.sortableColumn([true,true,true,true,true,true]); // You can specify which column would be sorted });
-
source for creating DOM div outside the tag element source
-
source for converting table rows into json object source
-
run style sass --watch assets/src/scss:assets/dist/css --style compressed
-
to view visit datatable from scratch vanilla javascript!!!