How to initialize Datatable plugin?

How to initialize Datatable plugin?

Datatables.net is a sophisticated plug in built on Jquery, JavaScript library which provides more functionality to normal HTML tables. The plug in offers search, pagination and sorting functionalities.
The assets file can be downloaded
  • From the website,
  • CDN
From website: https://datatables.net/download/index

CDN Links: https://cdn.datatables.net/





Basic Implementation of Datatable

  • Write the basic markup of the table with data
  • Add a class name to the table
  • Include all the assets
  • As Datatables.net is built on Jquery, make sure that Jquery is downloaded before data tables

Sites Followers Rank Country
SitePoint 11456 5 Canada
Learnable 123449 3 USA
Flippa 143567 1 Brazil

$(function(){
$("#example").dataTable();
})


Datatables plugin



You may continue this series in our next post Datatables.net Plugin options

Also, read how to manipulate DOM using jQuery

Comments

Popular posts from this blog

What are some mistakes people make when they start learning HTML, CSS and JavaScript?

Datatables.net - Plugin options