DataTables logo DataTables

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