
NPM is included with Node.js installation. Npm install datatables.It has now become a popular package manager for other open-source JavaScript frameworks like AngularJS, jQuery, Gulp, Bower etc. Npm install -select-dt // Styling via CSS only Npm install -scroller-dt // Styling via CSS only Npm install -rowreorder-dt // Styling via CSS only Npm install -rowgroup-dt // Styling via CSS only Npm install -keytable-dt // Styling via CSS only Npm install -fixedheader-dt // Styling via CSS only Npm install -fixedcolumns-dt // Styling via CSS onlyįixedHeader npm install -fixedheader

Npm install -colreorder-dt // Styling via CSS onlyįixedColumns npm install -fixedcolumns Require( '-buttons/js/' )() # Print view buttonĬolReorder npm install -colreorder Require( '-buttons/js/' )() # HTML 5 file export These button definition files can be optionally included using: require( '-buttons/js/' )() # Column visibility Note that using require('-buttons')() will include only the code Buttons library, and not the button definitions (such as column visibility, file exporting and print view). Select the styling framework that you wish to use from the buttons below:įoundation jQuery UI Semantic UI DataTables core npm install Įxtensions AutoFill npm install -autofillīuttons npm install -buttons Packages where this is the case are marked below with a Styling via CSS only comment. It is important to note that not all styling packages contain Javascript - some require CSS only in order to be correctly styled. In the above example the packages and -buttons are automatically resolved. The styling libraries will automatically resolve their own core library dependencies. Var buttons = require( '-buttons' )( window, $ ) Var buttons = require( '-buttons' )() Īnd with the window and jQuery arguments supplied: var $ = require( 'jquery' ) If no parameter is given, the package will do its own require('jquery') to include jQuery.įor example - no arguments: var $ = require( 'jquery' ) The jQuery object that DataTables should be attached to.If no parameter is given, or it is falsy, window will be used. The window object to use (this is require as jQuery in a headless CommonJS environment can require a window with a document attached).

The DataTables packages all export a factory function that can be executed with two optional arguments: The result is that you need to install a package for the library's core software plus a styling package in order for it to function and be styled correctly.

DataTables and its extensions are available as NPM packages.Īs DataTables supports multiple styling frameworks each of the libraries (DataTables and each of its extensions) are split into separate packages for the library's core software and its styling.
