Since: DataTables 1.10

Get the footer nodes for the selected columns.


This method can be used to obtain (and therefore modify) the footer cells used for multiple columns. This may be made up of th and / or td elements depending on the HTML for your table.

The cells returned are the cells from the first row in the table tfoot element relating to the selected columns. If you have multiple rows in the footer that you wish to manipulate you need to use the table().footer() method to obtain the table footer element and then use standard DOM / jQuery methods to manipulate the node.

Furthermore, the cells in the tfoot may span multiple columns using colspan (they can also use rowspan, but again, only the cells in the first row will be available using this method). As such, a cell which uses colspan may belong to multiple columns.

Note that table footers are optional in DataTables. If the columns found from the columns() call do not have footer elements, an empty result set will be returned.


function columns().footer()


Get the footer th / td cell for the selected columns.


DataTables API instance with header cells for the selected columns in the result set.


Sum all columns which have a class of .sum and put the sum into its footer cell:

var table = $('#example').DataTable();

table.columns( '.sum' ).every( function () {
	var sum = this
		.reduce( function (a,b) {
			return a + b;
		} );

	$( this.footer() ).html( 'Sum: '+sum );
} );


The following options are directly related and may also be useful in your application development.