{hero}

infoCallback

Since: DataTables 1.10

Table summary information display callback.

Description

The information element can be used to convey information about the current state of the table. Although the internationalisation options presented by DataTables are quite capable of dealing with most customisations, there may be times where you wish to customise the string further. This callback allows you to do exactly that.

Please note that if the info option is disabled in the initialisation, this callback function is not fired.

Type

function infoCallback( settings, start, end, max, total, pre )

Parameters:
Returns:

The string to be displayed in the information element.

Examples

Show start to end indexes in the information element:

$('#example').dataTable( {
  "infoCallback": function( settings, start, end, max, total, pre ) {
    return start +" to "+ end;
  }
} );

Use the API in the callback to show page count:

$('#example').dataTable( {
  "infoCallback": function( settings, start, end, max, total, pre ) {
    var api = this.api();
    var pageInfo = api.page.info();

    return 'Page '+ (pageInfo.page+1) +' of '+ pageInfo.pages;
  }
} );

Related

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