<?xml version="1.0" encoding="UTF-8" ?>
<dt-example table-type="html-wide" table-class="display nowrap" order="5">

<css lib="datatables responsive" />
<js lib="jquery datatables responsive">
<![CDATA[

$(document).ready(function() {
	$('#example').DataTable( {
		responsive: {
			details: {
				renderer: function ( api, rowIdx, columns ) {
					var data = $.map( columns, function ( col, i ) {
						return col.hidden ?
							'<tr data-dt-row="'+col.rowIndex+'" data-dt-column="'+col.columnIndex+'">'+
								'<td>'+col.title+':'+'</td> '+
								'<td>'+col.data+'</td>'+
							'</tr>' :
							'';
					} ).join('');

					return data ?
						$('<table/>').append( data ) :
						false;
				}
			}
		}
	} );
} );

]]>
</js>

<title lib="Responsive">Custom child row renderer</title>

<info><![CDATA[

The child row's for a collapsed table in Responsive, by default, show a `-tag ul/li` list of the data from the hidden columns. The `r-init responsive.details.renderer` option provide the ability to create your own custom renderer. It is given three parameters: the DataTables API instance for the table, the row index to use and an array of information about the columns - please refer to the `r-init responsive.details.renderer` documentation for full details of the object structure used in the array for each column.

This example shows the `columns` parameter that is passed in to display information only about the columns that Responsive has hidden. You could refine this to select only certain columns, or show all columns, etc.

]]></info>

</dt-example>

