Skip to content

Commit

Permalink
Improve DataTable.ext.buttons.pdfHtml5 to handle complex headers
Browse files Browse the repository at this point in the history
  • Loading branch information
mtyszler committed Jan 26, 2020
1 parent f94d7bb commit fecfcc2
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions js/buttons.html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -1333,12 +1333,16 @@ DataTable.ext.buttons.pdfHtml5 = {
var rows = [];

if ( config.header ) {
rows.push( $.map( data.header, function ( d ) {
return {
text: typeof d === 'string' ? d : d+'',
style: 'tableHeader'
};
} ) );
/* ----- BEGIN added/edited Code ----- */
for ( var i=0, ien=data.header.length ; i<ien ; i++ ) {
rows.push( $.map( data.header[i], function ( d ) {
return {
text: typeof d === 'string' ? d : d+'',
style: 'tableHeader'
};
} ) );
}
/* ----- END added/edited Code ----- */
}

for ( var i=0, ien=data.body.length ; i<ien ; i++ ) {
Expand Down

0 comments on commit fecfcc2

Please sign in to comment.