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.
DataTables HTML sorting auto-detection example

Preamble

It can be very useful to have DataTables default to it's built in type of HTML, rather than string, which a column does not fit the requirements of any other type. The way this method works is to put the 'html' type at the end of aTypes, which means it will be set as that type only if none of the other types match the data in question.

Live example

Reflection Link
DataTables DataTables
Integrity A link to Integrity
Integrity Integrity

Initialisation code

jQuery.fn.dataTableExt.aTypes.push(
	function ( sData ) {
		return 'html';
	}
);

$(document).ready(function() {
	$('#example').dataTable();
} );

Other examples