DataTables 2.2.0
DataTables CDN files for DataTables 2.2.0. This software was originally released on 6th January, 2025.
Release notes
Kicking the new year off with a significant release of DataTables! This release makes the manual calling of columns.adjust()
redundant by doing it automatically as a table is resized! There are also improvements in state restoring, styling framework integrations and more. Please see the release notes below for full details.
New
- Automatic resizing when the table's container changes width (uses
ResizeObserver
). The upshot of this is that you don't need to callcolumns.adjust()
any more if the table is made visible, having initially been hidden, or its container otherwise changes width due to some other resizing on the page. - Support for state restoring when columns have been reordered, added to or removed. This requires that
columns.name
be set to allow a column to be uniquely identifies. If it is not set then column state will not be loaded if the number of columns in the table changes (i.e. similar to 2.1-). html-utf8
data type which supports correct diacritic sorting - i.e. it is the same asstring-utf8
, but with support for HTML in the string.DataTable.use()
can now have Bootstrap (5) and Foundation JS libraries set so extensions such as Editor and Responsive can use the JS function (e.g. Modal). They had their own methods for that in the past (which will work for backwards compatibility), but this provides a single common approach for all libraries that DataTables components can use.- CSS variables to control row hover alpha
Updated
- Moved the tab focus (for keyboard access to ordering) to the ordering icon, rather than the full header cells. This makes a lot more sense as it acts as a button to trigger ordering, and it addresses a spec violation error which dictates that you cannot have
aria-sort
andtabindex
on the same elements. - State restore will still attempt to restore the state for paging, page length and search, even if the number of columns has changed.
- The state object now includes a
name
property for thecolumns
array and if a column name is set, in the sorting array.
Fixes
- If
columns.className
is used to define an alignment class such asdt-left
, it will now take priority over the automatic type detection classes. - Update
columns.orderData
documentation to note that you will likely want to include the original source column so the order indicator at the top of the table is correctly shown. layout
's output depended for a row depended on the orderStart
andEnd
were given in. That is no longer the case andStart
will always precedeEnd
in the DOM.- Remove the
name
attribute from the length dropdownselect
(pageLength
). This prevents it from being submitted in a form. - Headers which used colspan with a single row would throw an error
tabIndex
wasn't being obeyed for the column headers- Don't set
aria-disabled
on the ellipsis element for the pagination control - Set the
tfoot
to be hidden when it is empty to improve accessability - Bulma dark mode without a table footer would show a white border at the bottom of the table.
.use()
method wasn't using strict type checking for one check, which caused problems with ESM importsDataTable.ext.classes.thead.row
wouldn't apply to a header row that had been dynamically created by DataTables (only to existing header rows). The same with.tfoot.row
as well.- Potential stack overflow issues in Chrome when making large arrays
- When server-side processing is enabled, the columns could go out of alignment when paging
- Date render helpers wrt. setting locales in Luxon
typeDetect
option name was documented incorrectly- When using a CSS selector for the column selector (
columns()
) the order is now guaranteed to be in column index order. - Very old Safari (7/8) doesn't support
Array.from
which was used in one unprotected position. Support for DataTables is the main browsers for the last 10 years, so this has been addressed. - Sizing of columns when scrolling is enabled
- Check that the paging control has any width before triggering responsive control
Typescript
- Make the returned Node types more specific (e.g.
HTMLTableCellElement
and friends) - Correct
language.aria
types - Tighten up the types for
headerCallback
and other functions.
Docs
- Correct signature parameters names for
preXhr
- Correct old
error
event to bedt-error
Examples
- Handle the
readyState = interactive
condition when loading and adding libraries to be loaded. - Fix error in BS4 dark mode message
- Fix link to auto rendering example
Files
js
- //cdn.datatables.net/2.2.0/js/dataTables.bootstrap.js
- //cdn.datatables.net/2.2.0/js/dataTables.bootstrap.min.js
- //cdn.datatables.net/2.2.0/js/dataTables.bootstrap.min.mjs
- //cdn.datatables.net/2.2.0/js/dataTables.bootstrap.mjs
- //cdn.datatables.net/2.2.0/js/dataTables.bootstrap4.js
- //cdn.datatables.net/2.2.0/js/dataTables.bootstrap4.min.js
- //cdn.datatables.net/2.2.0/js/dataTables.bootstrap4.min.mjs
- //cdn.datatables.net/2.2.0/js/dataTables.bootstrap4.mjs
- //cdn.datatables.net/2.2.0/js/dataTables.bootstrap5.js
- //cdn.datatables.net/2.2.0/js/dataTables.bootstrap5.min.js
- //cdn.datatables.net/2.2.0/js/dataTables.bootstrap5.min.mjs
- //cdn.datatables.net/2.2.0/js/dataTables.bootstrap5.mjs
- //cdn.datatables.net/2.2.0/js/dataTables.bulma.js
- //cdn.datatables.net/2.2.0/js/dataTables.bulma.min.js
- //cdn.datatables.net/2.2.0/js/dataTables.bulma.min.mjs
- //cdn.datatables.net/2.2.0/js/dataTables.bulma.mjs
- //cdn.datatables.net/2.2.0/js/dataTables.dataTables.js
- //cdn.datatables.net/2.2.0/js/dataTables.dataTables.min.js
- //cdn.datatables.net/2.2.0/js/dataTables.dataTables.min.mjs
- //cdn.datatables.net/2.2.0/js/dataTables.dataTables.mjs
- //cdn.datatables.net/2.2.0/js/dataTables.foundation.js
- //cdn.datatables.net/2.2.0/js/dataTables.foundation.min.js
- //cdn.datatables.net/2.2.0/js/dataTables.foundation.min.mjs
- //cdn.datatables.net/2.2.0/js/dataTables.foundation.mjs
- //cdn.datatables.net/2.2.0/js/dataTables.jqueryui.js
- //cdn.datatables.net/2.2.0/js/dataTables.jqueryui.min.js
- //cdn.datatables.net/2.2.0/js/dataTables.jqueryui.min.mjs
- //cdn.datatables.net/2.2.0/js/dataTables.jqueryui.mjs
- //cdn.datatables.net/2.2.0/js/dataTables.js
- //cdn.datatables.net/2.2.0/js/dataTables.material.js
- //cdn.datatables.net/2.2.0/js/dataTables.material.min.js
- //cdn.datatables.net/2.2.0/js/dataTables.material.min.mjs
- //cdn.datatables.net/2.2.0/js/dataTables.material.mjs
- //cdn.datatables.net/2.2.0/js/dataTables.min.js
- //cdn.datatables.net/2.2.0/js/dataTables.min.mjs
- //cdn.datatables.net/2.2.0/js/dataTables.mjs
- //cdn.datatables.net/2.2.0/js/dataTables.semanticui.js
- //cdn.datatables.net/2.2.0/js/dataTables.semanticui.min.js
- //cdn.datatables.net/2.2.0/js/dataTables.semanticui.min.mjs
- //cdn.datatables.net/2.2.0/js/dataTables.semanticui.mjs
- //cdn.datatables.net/2.2.0/js/dataTables.tailwindcss.js
- //cdn.datatables.net/2.2.0/js/dataTables.tailwindcss.min.js
- //cdn.datatables.net/2.2.0/js/dataTables.tailwindcss.min.mjs
- //cdn.datatables.net/2.2.0/js/dataTables.tailwindcss.mjs
- //cdn.datatables.net/2.2.0/js/dataTables.uikit.js
- //cdn.datatables.net/2.2.0/js/dataTables.uikit.min.js
- //cdn.datatables.net/2.2.0/js/dataTables.uikit.min.mjs
- //cdn.datatables.net/2.2.0/js/dataTables.uikit.mjs
css
- //cdn.datatables.net/2.2.0/css/dataTables.bootstrap.css
- //cdn.datatables.net/2.2.0/css/dataTables.bootstrap.min.css
- //cdn.datatables.net/2.2.0/css/dataTables.bootstrap4.css
- //cdn.datatables.net/2.2.0/css/dataTables.bootstrap4.min.css
- //cdn.datatables.net/2.2.0/css/dataTables.bootstrap5.css
- //cdn.datatables.net/2.2.0/css/dataTables.bootstrap5.min.css
- //cdn.datatables.net/2.2.0/css/dataTables.bulma.css
- //cdn.datatables.net/2.2.0/css/dataTables.bulma.min.css
- //cdn.datatables.net/2.2.0/css/dataTables.dataTables.css
- //cdn.datatables.net/2.2.0/css/dataTables.dataTables.min.css
- //cdn.datatables.net/2.2.0/css/dataTables.foundation.css
- //cdn.datatables.net/2.2.0/css/dataTables.foundation.min.css
- //cdn.datatables.net/2.2.0/css/dataTables.jqueryui.css
- //cdn.datatables.net/2.2.0/css/dataTables.jqueryui.min.css
- //cdn.datatables.net/2.2.0/css/dataTables.material.css
- //cdn.datatables.net/2.2.0/css/dataTables.material.min.css
- //cdn.datatables.net/2.2.0/css/dataTables.semanticui.css
- //cdn.datatables.net/2.2.0/css/dataTables.semanticui.min.css
- //cdn.datatables.net/2.2.0/css/dataTables.tailwindcss.css
- //cdn.datatables.net/2.2.0/css/dataTables.tailwindcss.min.css
- //cdn.datatables.net/2.2.0/css/dataTables.uikit.css
- //cdn.datatables.net/2.2.0/css/dataTables.uikit.min.css