RESPONSIVE Datatables - change design of hidden area (child area)
RESPONSIVE Datatables - change design of hidden area (child area)
antonis80
Posts: 18Questions: 8Answers: 0
Hi
I am using this code:
$('#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;
}
}
}
} );
To create a table of the child area, However i need a table that will display all column headings in a single row and then on another row the data.
Is this possible?
Thanks in advance
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This discussion has been closed.
Answers
Hi @antonis80 ,
That's possible, you just need to add another
<tr>
element into the returned data.Cheers,
Colin
Thanks Colin,
I did it with the following:
responsive: {
details: {
renderer: function ( api, rowIdx, columns ) {