DataTables logo DataTables

This site contains the legacy documentation for DataTables v1.9 and earlier for reference only.
DataTables 1.9 was End Of Life in 2014. Do not use it for new work.
The current release of DataTables can always be found on DataTables.net.

Language

The language information presented by DataTables can be completely altered for internationalisation (or localisation) using the properties of the oLanguage object. Note that all strings in the following may contain HTML tags (i.e. you can include images etc. if you so wish in them).

oLanguage.oAria.sSortAscending
Show details

ARIA label that is added to the table headers when the column may be sorted ascending by activing the column (click or return when focused). Note that the column header is prefixed to this string.

Default: : activate to sort column ascending
Type: string
Code example:
   $(document).ready( function() {
     $('#example').dataTable( {
       "oLanguage": {
         "oAria": {
           "sSortAscending": " - click/return to sort ascending"
         }
       }
     } );
   } );
oLanguage.oAria.sSortDescending
Show details

ARIA label that is added to the table headers when the column may be sorted descending by activing the column (click or return when focused). Note that the column header is prefixed to this string.

Default: : activate to sort column ascending
Type: string
Code example:
   $(document).ready( function() {
     $('#example').dataTable( {
       "oLanguage": {
         "oAria": {
           "sSortDescending": " - click/return to sort descending"
         }
       }
     } );
   } );
oLanguage.oPaginate.sFirst
Show details

Text to use when using the 'full_numbers' type of pagination for the button to take the user to the first page.

Default: First
Type: string
Code example:
   $(document).ready( function() {
     $('#example').dataTable( {
       "oLanguage": {
         "oPaginate": {
           "sFirst": "First page"
         }
       }
     } );
   } );
oLanguage.oPaginate.sLast
Show details

Text to use when using the 'full_numbers' type of pagination for the button to take the user to the last page.

Default: Last
Type: string
Code example:
   $(document).ready( function() {
     $('#example').dataTable( {
       "oLanguage": {
         "oPaginate": {
           "sLast": "Last page"
         }
       }
     } );
   } );
oLanguage.oPaginate.sNext
Show details

Text to use for the 'next' pagination button (to take the user to the next page).

Default: Next
Type: string
Code example:
   $(document).ready( function() {
     $('#example').dataTable( {
       "oLanguage": {
         "oPaginate": {
           "sNext": "Next page"
         }
       }
     } );
   } );
oLanguage.oPaginate.sPrevious
Show details

Text to use for the 'previous' pagination button (to take the user to

the previous page).

Default: Previous
Type: string
Code example:
   $(document).ready( function() {
     $('#example').dataTable( {
       "oLanguage": {
         "oPaginate": {
           "sPrevious": "Previous page"
         }
       }
     } );
   } );
oLanguage.sEmptyTable
Show details

This string is shown in preference to sZeroRecords when the table is empty of data (regardless of filtering). Note that this is an optional parameter - if it is not given, the value of sZeroRecords will be used instead (either the default or given value).

Default: No data available in table
Type: string
Code example:
   $(document).ready( function() {
     $('#example').dataTable( {
       "oLanguage": {
         "sEmptyTable": "No data available in table"
       }
     } );
   } );
oLanguage.sInfo
Show details

This string gives information to the end user about the information that is current on display on the page. The START, END and TOTAL variables are all dynamically replaced as the table display updates, and can be freely moved or removed as the language requirements change.

Default: Showing _START_ to _END_ of _TOTAL_ entries
Type: string
Code example:
   $(document).ready( function() {
     $('#example').dataTable( {
       "oLanguage": {
         "sInfo": "Got a total of _TOTAL_ entries to show (_START_ to _END_)"
       }
     } );
   } );
oLanguage.sInfoEmpty
Show details

Display information string for when the table is empty. Typically the format of this string should match sInfo.

Default: Showing 0 to 0 of 0 entries
Type: string
Code example:
   $(document).ready( function() {
     $('#example').dataTable( {
       "oLanguage": {
         "sInfoEmpty": "No entries to show"
       }
     } );
   } );
oLanguage.sInfoFiltered
Show details

When a user filters the information in a table, this string is appended to the information (sInfo) to give an idea of how strong the filtering is. The variable MAX is dynamically updated.

Default: (filtered from _MAX_ total entries)
Type: string
Code example:
   $(document).ready( function() {
     $('#example').dataTable( {
       "oLanguage": {
         "sInfoFiltered": " - filtering from _MAX_ records"
       }
     } );
   } );
oLanguage.sInfoPostFix
Show details

If can be useful to append extra information to the info string at times, and this variable does exactly that. This information will be appended to the sInfo (sInfoEmpty and sInfoFiltered in whatever combination they are being used) at all times.

Default: Empty string
Type: string
Code example:
   $(document).ready( function() {
     $('#example').dataTable( {
       "oLanguage": {
         "sInfoPostFix": "All records shown are derived from real information."
       }
     } );
   } );
oLanguage.sInfoThousands
Show details

DataTables has a build in number formatter (fnFormatNumber) which is used to format large numbers that are used in the table information. By default a comma is used, but this can be trivially changed to any character you wish with this parameter.

Default: ,
Type: string
Code example:
   $(document).ready( function() {
     $('#example').dataTable( {
       "oLanguage": {
         "sInfoThousands": "'"
       }
     } );
   } );
oLanguage.sLengthMenu
Show details

Detail the action that will be taken when the drop down menu for the pagination length option is changed. The 'MENU' variable is replaced with a default select list of 10, 25, 50 and 100, and can be replaced with a custom select box if required.

Default: Show _MENU_ entries
Type: string
Code example:
   // Language change only
   $(document).ready( function() {
     $('#example').dataTable( {
       "oLanguage": {
         "sLengthMenu": "Display _MENU_ records"
       }
     } );
   } );
   
 
   // Language and options change
   $(document).ready( function() {
     $('#example').dataTable( {
       "oLanguage": {
         "sLengthMenu": 'Display  records'
       }
     } );
   } );
oLanguage.sLoadingRecords
Show details

When using Ajax sourced data and during the first draw when DataTables is gathering the data, this message is shown in an empty row in the table to indicate to the end user the the data is being loaded. Note that this parameter is not used when loading data by server-side processing, just Ajax sourced data with client-side processing.

Default: Loading...
Type: string
Code example:
   $(document).ready( function() {
     $('#example').dataTable( {
       "oLanguage": {
         "sLoadingRecords": "Please wait - loading..."
       }
     } );
   } );
oLanguage.sProcessing
Show details

Text which is displayed when the table is processing a user action (usually a sort command or similar).

Default: Processing...
Type: string
Code example:
   $(document).ready( function() {
     $('#example').dataTable( {
       "oLanguage": {
         "sProcessing": "DataTables is currently busy"
       }
     } );
   } );
oLanguage.sSearch
Show details

Details the actions that will be taken when the user types into the filtering input text box. The variable "INPUT", if used in the string, is replaced with the HTML text box for the filtering input allowing control over where it appears in the string. If "INPUT" is not given then the input box is appended to the string automatically.

Default: Search:
Type: string
Code example:
   // Input text box will be appended at the end automatically
   $(document).ready( function() {
     $('#example').dataTable( {
       "oLanguage": {
         "sSearch": "Filter records:"
       }
     } );
   } );
   
 
   // Specify where the filter should appear
   $(document).ready( function() {
     $('#example').dataTable( {
       "oLanguage": {
         "sSearch": "Apply filter _INPUT_ to table"
       }
     } );
   } );
oLanguage.sUrl
Show details

All of the language information can be stored in a file on the server-side, which DataTables will look up if this parameter is passed. It must store the URL of the language file, which is in a JSON format, and the object has the same properties as the oLanguage object in the initialiser object (i.e. the above parameters). Please refer to one of the example language files to see how this works in action.

Default: Empty string - i.e. disabled
Type: string
Code example:
   $(document).ready( function() {
     $('#example').dataTable( {
       "oLanguage": {
         "sUrl": "http://www.sprymedia.co.uk/dataTables/lang.txt"
       }
     } );
   } );
oLanguage.sZeroRecords
Show details

Text shown inside the table records when the is no information to be displayed after filtering. sEmptyTable is shown when there is simply no information in the table at all (regardless of filtering).

Default: No matching records found
Type: string
Code example:
   $(document).ready( function() {
     $('#example').dataTable( {
       "oLanguage": {
         "sZeroRecords": "No records to display"
       }
     } );
   } );