DataTables 2.1.0
DataTables CDN files for DataTables 2.1.0. This software was originally released on 19th July, 2024.
Release notes
DataTables 2.1 is here! There are a number of new features and improvements, particularly for the layout grid of features around the DataTable. There are also internationalisation improvements, type detection enhancements and a whole number of fixes.
Full details are available below in the release notes, and summary documents are also available:
New
div
feature which can be used to insert text or HTML in the DataTables controlled layout grid. It does not provide any information or control over the table itself.layout
now has the ability to set class names on the rows and cells of the layout grid. This gives you complete control over the markup that is used to control the grid, allowing it to fully replace all options that exist indom
.- DataTables styling updated to use flexbox for layout, allowing much more flexibility.
- All styling frameworks updated to have control elements which are in the same position (i.e. an array of items) will now place them side by side.
- All styling frameworks will evenly space layout full row items.
- If no
width
style orwidth
attribute is found on thetable
, we now automatically assign the table 100%. If either is found, they are retained. This is done to simplify the HTML needed, and thewidth
attribute is long since obsolete in HTML (although still works). DisablingautoWidth
will stop 100% width being assigned automatically. - Reintroduce the
deferLoading
option which is used to delay the first request for data when server-side processing is enabled until the second draw of the table. - Type detection is now far more functional in that it it is possible to specify that at least one data point in a column match a specific test. Previously all data points had to pass a given test (
allOf
), but now in addition to that an extra function can be given to help limit data selection (oneOf
). - Automatic detection and ordering for accented characters in the data set. This is done by making use of the improved data type detection to allow non-UTF8 columns to continue to use simple ASCII string sorting (for performance), but columns with UTF-8 characters in them will now use
localeCompare
automatically for sorting, which the locale specified by the end user's browser preferences. Please note that this requires Safari 10.1 or newer if you are using Safari. If you are using an older version, it will automatically fallback to treating the column as a simple string type. orderDescReverse
option which can be used to disable the reversal of data when doing a descending order. This can make the ordering of data more like how Excel operates when data matches in the column being ordered on.language.aria.paginate.number
option which can be used to set an ARIA label for the number buttons in the pagination control.search.processing
option which can be used to show the processing indicator (processing
) when the end user types into the search box.- Ability to control what buttons appear in the paging control through three new options for the feature. This provides similar functionality to
paging.type
but is more intuitive. It also allows the paging feature code to be more compartmentalised, and will allow a reduction in code size when the deprecated properties are removed. The new options are: DataTable.use()
method which can inform DataTables libraries such as Moment and Luxon in a module loader environment.- Support for Bulma 1 and Bulma's new dark mode
- Automatically detect
d
as a string on a JSON response and parse it as JSON for use (if it is valid JSON). This is for improved compatibility with .NET soajax.dataSrc
doesn't need to be specified for this wrapper. nav
element is now used to wrap around the pagination control. This is done to help improve accessability. To preserve CSS backwards compatibility the host elementdiv.dt-paging
is retained, and the newnav
is a child of that, with the paging elements and child of that in turn. It means there is an extra tag than can be considered redundant, but that's the trade off for adding the element.
Deprecated
pagingType
andpaging.type
are now redundant and will be removed in DataTables 3. If you are using these properties it is recommended that you update them when possible.
Updates
- Use
button
elements for Bootstrap 5's pagination control, as they are more suitable for in page navigation and Bootstrap fully supports this. - If there are multiple
layout
items in a single cell, they will now show on the same line on larger screens and collapse to a single column for small screens. - Disable auto type detection when server-side processing is enabled. Without the full data set available it is unreliable and error prone. If you need specific type actions (e.g. a class name) you can assign a type to a column using
columns.type
.
Fixes
- Using a
<span>
inlanguage.lengthMenu
could result in duplication of the page length<select>
tag. aria-sort
attribute would not be added to the table if multi-column ordering and the first column to be ordered upon was hidden.- Don't add
tabIndex
to the paging buttons if its value is0
as it is redundant - Tidy up the order of initialisation when a language file is loaded
- It was possible for date time types to overlap due to the replacement of characters in the name. That is not required as the data type names are just a plain string.
- The new type detection is used to prevent HTML columns without numbers being detected as numeric columns (e.g. this happened with FontAwesome icons in a column).
- Type detection was not running if both ordering and searching were disabled.
- Tighten the
date
data type detection to make sure at least one cell has a date in it. - If
ajax.url === ''
theajax.data
parameter would only correctly trigger once. - Reordering initial data load to allow
data-*
attributes to be used to define column data points
Examples
- New examples for grid layout and id/class demonstrations.
Docs
- Add mention of how to restore the DataTables 1.x
columns.orderSequence
default value to the documentation for that parameter. layout
update for id and class name options, plus a bit of rearrangement- Fix link to
dt-error
- Reflect that the aria values for pagination are now set in 2.0+
Files
js
- //cdn.datatables.net/2.1.0/js/dataTables.bootstrap.js
- //cdn.datatables.net/2.1.0/js/dataTables.bootstrap.min.js
- //cdn.datatables.net/2.1.0/js/dataTables.bootstrap.min.mjs
- //cdn.datatables.net/2.1.0/js/dataTables.bootstrap.mjs
- //cdn.datatables.net/2.1.0/js/dataTables.bootstrap4.js
- //cdn.datatables.net/2.1.0/js/dataTables.bootstrap4.min.js
- //cdn.datatables.net/2.1.0/js/dataTables.bootstrap4.min.mjs
- //cdn.datatables.net/2.1.0/js/dataTables.bootstrap4.mjs
- //cdn.datatables.net/2.1.0/js/dataTables.bootstrap5.js
- //cdn.datatables.net/2.1.0/js/dataTables.bootstrap5.min.js
- //cdn.datatables.net/2.1.0/js/dataTables.bootstrap5.min.mjs
- //cdn.datatables.net/2.1.0/js/dataTables.bootstrap5.mjs
- //cdn.datatables.net/2.1.0/js/dataTables.bulma.js
- //cdn.datatables.net/2.1.0/js/dataTables.bulma.min.js
- //cdn.datatables.net/2.1.0/js/dataTables.bulma.min.mjs
- //cdn.datatables.net/2.1.0/js/dataTables.bulma.mjs
- //cdn.datatables.net/2.1.0/js/dataTables.dataTables.js
- //cdn.datatables.net/2.1.0/js/dataTables.dataTables.min.js
- //cdn.datatables.net/2.1.0/js/dataTables.dataTables.min.mjs
- //cdn.datatables.net/2.1.0/js/dataTables.dataTables.mjs
- //cdn.datatables.net/2.1.0/js/dataTables.foundation.js
- //cdn.datatables.net/2.1.0/js/dataTables.foundation.min.js
- //cdn.datatables.net/2.1.0/js/dataTables.foundation.min.mjs
- //cdn.datatables.net/2.1.0/js/dataTables.foundation.mjs
- //cdn.datatables.net/2.1.0/js/dataTables.jqueryui.js
- //cdn.datatables.net/2.1.0/js/dataTables.jqueryui.min.js
- //cdn.datatables.net/2.1.0/js/dataTables.jqueryui.min.mjs
- //cdn.datatables.net/2.1.0/js/dataTables.jqueryui.mjs
- //cdn.datatables.net/2.1.0/js/dataTables.js
- //cdn.datatables.net/2.1.0/js/dataTables.material.js
- //cdn.datatables.net/2.1.0/js/dataTables.material.min.js
- //cdn.datatables.net/2.1.0/js/dataTables.material.min.mjs
- //cdn.datatables.net/2.1.0/js/dataTables.material.mjs
- //cdn.datatables.net/2.1.0/js/dataTables.min.js
- //cdn.datatables.net/2.1.0/js/dataTables.min.mjs
- //cdn.datatables.net/2.1.0/js/dataTables.mjs
- //cdn.datatables.net/2.1.0/js/dataTables.semanticui.js
- //cdn.datatables.net/2.1.0/js/dataTables.semanticui.min.js
- //cdn.datatables.net/2.1.0/js/dataTables.semanticui.min.mjs
- //cdn.datatables.net/2.1.0/js/dataTables.semanticui.mjs
- //cdn.datatables.net/2.1.0/js/dataTables.tailwindcss.js
- //cdn.datatables.net/2.1.0/js/dataTables.tailwindcss.min.js
- //cdn.datatables.net/2.1.0/js/dataTables.tailwindcss.min.mjs
- //cdn.datatables.net/2.1.0/js/dataTables.tailwindcss.mjs
- //cdn.datatables.net/2.1.0/js/dataTables.uikit.js
- //cdn.datatables.net/2.1.0/js/dataTables.uikit.min.js
- //cdn.datatables.net/2.1.0/js/dataTables.uikit.min.mjs
- //cdn.datatables.net/2.1.0/js/dataTables.uikit.mjs
css
- //cdn.datatables.net/2.1.0/css/dataTables.tailwindcss.min.css
- //cdn.datatables.net/2.1.0/css/dataTables.uikit.css
- //cdn.datatables.net/2.1.0/css/dataTables.uikit.min.css
- //cdn.datatables.net/2.1.0/css/dataTables.bootstrap.css
- //cdn.datatables.net/2.1.0/css/dataTables.bootstrap.min.css
- //cdn.datatables.net/2.1.0/css/dataTables.bootstrap4.css
- //cdn.datatables.net/2.1.0/css/dataTables.bootstrap4.min.css
- //cdn.datatables.net/2.1.0/css/dataTables.bootstrap5.css
- //cdn.datatables.net/2.1.0/css/dataTables.bootstrap5.min.css
- //cdn.datatables.net/2.1.0/css/dataTables.bulma.css
- //cdn.datatables.net/2.1.0/css/dataTables.bulma.min.css
- //cdn.datatables.net/2.1.0/css/dataTables.dataTables.css
- //cdn.datatables.net/2.1.0/css/dataTables.dataTables.min.css
- //cdn.datatables.net/2.1.0/css/dataTables.foundation.css
- //cdn.datatables.net/2.1.0/css/dataTables.foundation.min.css
- //cdn.datatables.net/2.1.0/css/dataTables.jqueryui.css
- //cdn.datatables.net/2.1.0/css/dataTables.jqueryui.min.css
- //cdn.datatables.net/2.1.0/css/dataTables.material.css
- //cdn.datatables.net/2.1.0/css/dataTables.material.min.css
- //cdn.datatables.net/2.1.0/css/dataTables.semanticui.css
- //cdn.datatables.net/2.1.0/css/dataTables.semanticui.min.css
- //cdn.datatables.net/2.1.0/css/dataTables.tailwindcss.css