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.
ColReorder example with predefined column ordering

Preamble

ColReorder provides the ability to specify a column ordering which is not that of the HTML (which typically you will want) through the parameter oColReorder.aiOrder. This is an array of integers with the column ordering you want.

Live example

CSS gradeEngine versionPlatform(s)BrowserRendering engine
CSS gradeEngine versionPlatform(s)BrowserRendering engine
A1.8Win 98+ / OSX.2+Firefox 1.5Gecko
A1.8Win 98+ / OSX.2+Firefox 2.0Gecko
A1.9Win 2k+ / OSX.3+Firefox 3.0Gecko
A1.8OSX.2+Camino 1.0Gecko
A1.8OSX.3+Camino 1.5Gecko
A1.7Win 95+ / Mac OS 8.6-9.2Netscape 7.2Gecko
A1.7Win 98SE+Netscape Browser 8Gecko
A1.8Win 98+ / OSX.2+Netscape Navigator 9Gecko
A1Win 95+ / OSX.1+Mozilla 1.0Gecko
A1.1Win 95+ / OSX.1+Mozilla 1.1Gecko
Showing 1 to 10 of 57 entries

Examples

Initialisation code

$(document).ready( function () {
	var oTable = $('#example').dataTable( {
		"sDom": 'Rlfrtip',
		"oColReorder": {
			"aiOrder": [ 4, 3, 2, 1, 0 ]
		}
	} );
} );