DataTables with column rendering

Preamble

You may specify a function for each column to render the available data in a specific manner which will be called when the table is drawn. In this example I've appended the rendering engine version to the rendering engine name in the first column, and hidden the version column.

Live example

Show entries
Search:
Rendering engine Browser Platform(s) CSS grade
Rendering engine Browser Platform(s) CSS grade
Gecko 1 Mozilla 1.0 Win 95+ / OSX.1+ A
Gecko 1.1 Mozilla 1.1 Win 95+ / OSX.1+ A
Gecko 1.2 Mozilla 1.2 Win 95+ / OSX.1+ A
Gecko 1.3 Mozilla 1.3 Win 95+ / OSX.1+ A
Gecko 1.4 Mozilla 1.4 Win 95+ / OSX.1+ A
Gecko 1.5 Mozilla 1.5 Win 95+ / OSX.1+ A
Gecko 1.6 Mozilla 1.6 Win 95+ / OSX.1+ A
Gecko 1.7 Firefox 1.0 Win 98+ / OSX.2+ A
Gecko 1.7 Netscape 7.2 Win 95+ / Mac OS 8.6-9.2 A
Gecko 1.7 Netscape Browser 8 Win 98SE+ A
Showing 1 to 10 of 57 entries

Initialisation code

$(document).ready(function() {
	$('#example').dataTable( {
		"aoColumnDefs": [ 
			{
				"fnRender": function ( oObj ) {
					return oObj.aData[0] +' '+ oObj.aData[3];
				},
				"aTargets": [ 0 ]
			},
			{ "bVisible": false,  "aTargets": [ 3 ] },
			{ "sClass": "center", "aTargets": [ 4 ] }
		]
	} );
} );

Other examples

Basic initialisation

Advanced initialisation

Data sources

Server-side processing

API

Plug-ins

Please refer to the DataTables documentation for full information about its API properties and methods.