Have required JavaScript
and CSS
files included in your index.html
. You can do this by either using the CDN files availiable at the following paths:
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.12/css/jquery.dataTables.css">
<script type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.12/js/jquery.dataTables.js"></script>
Or by downloading individual local files and hosting them yourself. To get a comprehensive package of required JavaScript
and CSS
files visit the DataTables download builder which will allow you to pick and choose features you need and condense them into a single package (or offer individual files). Include these in the order displayed at the bottom of the page.
DataTables depends on jQuery
, so include it before jquery.dataTables.js
:
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
DataTables are also available through NPM
npm install datatables.net # Core library
npm install datatables.net-dt # Styling
and Bower
bower install --save datatables.net
bower install --save datatables.net-dt