{hero}

columns().render()

Since: DataTables 2.0.0

Get rendered data for a collection of columns.

Description

This method provides access to the orthogonal data that DataTables uses for each cell (in this case in the form of columns). This allows the same data to be used in different ways. A typical example of this is date / time data being used in numeric format (i.e. a timestamp) for sorting, but a complex formatted form for display.

The cells().data() method provides access to the underlying raw data, while this method provides access to the rendered data for each type. It is provided to allow plug-in authors access to the orthogonal data available in the table.

Note that calling this method will evaluate the renderer for the cell, rather than reading the information from cache (see cells().cache() to read from cache and cells().invalidate() to clear cache).

Type

function columns().render( type )

Description:

Get rendered data for the selected columns

Parameters:
Returns:

DataTables API instance with the data for each selected column in the result set

Example

Get the display information for a column:

var table = new DataTable('#myTable');
var rendered = table.columns(1).render();

console.log(rendered);

Related

The following options are directly related and may also be useful in your application development.