AutoFill

Spreadsheets such as Excel and Google Docs have a very handy data duplication option of an auto fill tool. The AutoFill library for DataTables provides a similar interface for DataTables and extends upon this interface paradigm to provide complex data interaction options that the user can select between.

Download

The easiest way to get and use AutoFill is to use the DataTables download builder where you can select the software that you wish to use on your page and have a single Javascript and CSS file created and hosted for you.

Alternatively, the individual files can be included on your page, a release package downloaded or the source control repository cloned on GitHub.

Initialisation

AutoFill is enabled for a DataTable using the autoFill option - its simplest form is simply setting that parameter to true:

$('#myTable').DataTable( {
    autoFill: true
} );

You can of course combine this initialisation with any of the other DataTables initialisation options and extensions to create a table with the features you want.

The autoFill option can also be given as an object which provides fine grained control of the software and its behaviour - see the options reference for full details.

Features

AutoFill enjoys the following features:

  • Click and drag cell content insertion
  • Automatic incrementing of numeric information
  • Enable on any column
  • Data fill type selector