6fbd3ba8e6
- Column width is always a particularly difficult one to get quite right. In this case, the fix is to have DataTables read column width information from the `width` or `style` attributes of a column header cell, if that information is present. If it is, it is treated as sWidth is (although user supplied sWidth can override). That is it say that it will be applied to the column width calculation table. - The remaining gap is if a developer assigns a width using css classes. We can't get that information, so we fall into the old problem. - This change comes about from the discussion in http://datatables.net/forums/discussion/19089 and the fiddle here: http://jsfiddle.net/EysLd/1/ - What is happening in the test case is that the calculation table is being created, but it is then stripped of widths due to this commit: https://github.com/DataTables/DataTables/commit/6a9e324 . That was to allow DataTables column headers to have their applied size removed, so a new size could be calculated. Only sWidth would override that - now the width and style attributes will as well |
||
---|---|---|
examples | ||
media | ||
.datatables-commit-sync | ||
.gitignore | ||
bower.json | ||
composer.json | ||
Contributing.md | ||
dataTables.jquery.json | ||
license.txt | ||
package.json | ||
Readme.md |
DataTables plug-in for jQuery
DataTables is a table enhancing plug-in for the jQuery Javascript library, adding sorting, paging and filtering abilities to plain HTML tables with minimal effort. The stated goal of DataTables is:
To enhance the accessibility of data in HTML tables.
To meet this goal, DataTables is developed with two distinct groups of users in mind:
-
You the developers using DataTables. For developers DataTables provides a wide array of options for how data should be obtained, displayed and acted upon, along with an extensive API for accessing and manipulating the table.
-
End users. For those using the interface DataTables presents, actions to get the most from the information contained in tables, such as sorting and filtering, along with paging and scrolling of the data in table, are easy to use, intuitive and fast.
Installation
In most cases, to use DataTables all you need to do is include jQuery, the DataTables Javascript and DataTables CSS files in your HTML page:
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10-dev/css/jquery.dataTables.css">
<script type="text/javascript" language="javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" language="javascript" src="//cdn.datatables.net/1.10-dev/js/jquery.dataTables.js"></script>
Usage
In its simplest case, DataTables can be initialised with a single line of Javascript:
$('table').dataTable();
where the jQuery selector is used to obtain a reference to the table you want to enhance with DataTables. Optional configuration parameters can be passed in to DataTables to have it perform certain actions by using a configuration object as the parameter passed in to the DataTables constructor. For example:
$('table').dataTable( {
paginate: false,
scrollY: 300
} );
will disable paging and enable scrolling.
A full list of the options available for DataTables are available in the documentation.
Documentation
Full documentation of the DataTables options, API and pug-in interface are available on the DataTables web-site. The site also contains information on the wide variety of plug-ins that are available for DataTables, which can be used to enhance and customise your table even further.
Support
Support for DataTables is available through the DataTables forums and commercial support options are available.
License
DataTables is release under the MIT license. You are free to use, modify and distribute this software, as long as the copyright header is left intact (specifically the comment block which starts with /*!
.