DataTables logo DataTables

via Ad Packs

Frequently Asked Questions

DataTables is a complex piece of software and undoubtedly questions will arise from it's use. Some of these questions have already been posed and answered, and most common of which are shown here.

Getting help

Q. I have a question - how can I get help?
A. The best place to get help for DataTables is on this site. There is extensive documentation, examples, these FAQs and the forum for help. If you can't find the answer to your question on the site already, please post it in the forum.

Q. I need to get an answer to this question as soon as possible!
A. Post your question in the forum as normal, and then use the support page to purchase a support package for DataTables. Purchasing support ensures you will receive assistance with the problem you are having, and also helps support the DataTables project as a whole.

Q. How quickly can I expect a reply to my forum post?
A. The best way to ensure that you get a reply to your question is to purchase a support option. Response times will of course vary, but one will come normally within a day, but it can sometimes take longer (for example if people are away on holiday or have other commitments etc). If this is the case please don't be offended!

Licensing

Q. DataTables is great! How much is it?
A. DataTables is free, open source software that you can download and use for whatever purpose you wish, on any and as many sites you want. It is free for you to use! DataTables is available under two licenses: GPL v2 license or a BSD (3-point) license, with which you must comply (to do this, basically keep the copyright notices in the software).

Q. Which license applies to DataTables?
A. You can pick which of the two available licenses you wish to use DataTables under - pick whichever one suits your project.

Q. Really - its free, even for commercial sites?!
A. Yes! I'm very proud of what has been achieved with DataTables and the fantastic community that has helped it to get to where it is today, and I'm delighted to make it available as open source. Obviously if you benefit from DataTables then any reciprocation is very welcome, be it as a plug-in for DataTables, a donation to future development or a blog post saying you enjoy using DataTables.

Q. We can't use GPLv2 or BSD (3-point) licensed software. What do we do?
A. In the rare case that you can't use DataTables under either of the available licenses, please get in touch to discuss alternative licensing arrangements.

Development FAQs

Q. This is amazing software - how can contribute?

  • Write about DataTables on your blog and spread the word!
  • Create plug-ins for DataTables which can be show-cased on this site.
  • Answer support questions in the forums.
  • Contribute patches to any bugs you find - test for bugs.
  • Make a donation!

Q. Can I pay for integration support?
A. Yes! There are support packages for DataTables integration available.

Q. I have created a plug-in - how can I share it with everyone else?
A. Please send it to me direct, or post it in the forum.

Q. I think I have found a bug - how do I report it?
A. Please post your bug, along with as much information as possible for how to recreate it, in the forum.

Q. You use Hungarian notation - why?!?
A. When I wrote the first version of DataTables, the company I was working for then had strict coding standards that required the use of Hungarian notation, so I was "trained" in it at the time and I've never wanted to break compatibility by changing to a new API.

Most common FAQs

Q. My events don't work on the second page (events in general)
A. When attaching events to cells in a table controlled by DataTables, you need to be careful how it is done. Because DataTables removes nodes from the DOM, event's might not be applied. To over come this, is quite simple, as shown in these examples: pre-initialisation, post-initialisation. $().live() events can also help. Finally you use my Visual Event bookmarklet to help debug event issues.

Q. I get a JSON parsing error
A. This is due to incorrect JSON data being passed back from the server. Please test your JSON return with JSON Lint before posting in the forum (the return can be viewed by using Firebug, or the like).

Q. I get a Javascript error in IE, but not in Firefox, Chrome etc.
A. The majority of the time, this is caused by a 'floating' comma at the end of an array. IE will throw a warning for this, other will delete it.

General initialisation

Q. DataTables is running slow. How can I speed it up?
A. There are several ways in which you can speed up DataTables. If you are using DOM data, then you can disable the sorting classes (the highlighting column) using bSortClasses. If this isn't enough, then you can use server-side processing, which will work for millions of rows.

Q. My table isn't working!?
A. Have you got a <thead> and <tbody> defined as DataTables requires (basic usage)? Is your HTML valid (W3C validator)? Are you seeing any Javascript errors?

Q. My styles aren't showing up / my table isn't styled.
A. Have you included the demo CSS for DataTables on your page (and got the paths correct!)? As a side-note I would strongly encourage customisation of the DataTables demo CSS.

Q. How can I move the table controls?
A. You can move the elements that DataTables puts around the table by using the sDom initialisation parameter.

Server-side processing

Q. Its not working... (stuck on processing)
A. This is usually down to incorrect JSON data being passed back from the server. Please test your JSON return with JSON Lint before posting in the forum.

Q. Its still not working...
A. The next most common reason for server-side processing not working is the sEcho variable not being returned as it was set in the request. DataTables uses sEcho to keep a draw count, so this is an important parameter. See server-side usage.

Q. Pagination is not enabled, or the information text shows the wrong data set count
A. This is likely to be caused by the incorrect use of iTotalDisplayRecords. iTotalDisplayRecords is the total number of records in the data set after filtering - not just the data array length (which DataTables can do itself!). So if you have no filtering iTotalDisplayRecords should be exactly the same as iTotalRecords.

Q. My events aren't being applied
A. What happens is that for each draw, DataTables will create the required display nodes (TR, TD etc), so old events are lost. You can either use $.live, or fnDrawCallback to re-add the events. You can also use my Visual Event bookmarklet to help debug event issues.