Skip to content

Instantly share code, notes, and snippets.

@emranch31
Last active October 6, 2017 05:41
Show Gist options
  • Save emranch31/fb89e567a814b9f0314f2eae2394ac93 to your computer and use it in GitHub Desktop.
Save emranch31/fb89e567a814b9f0314f2eae2394ac93 to your computer and use it in GitHub Desktop.
this gist is just only for data Table buttons functionality with padding and alignment
buttons: [
{
extend: 'csvHtml5',
title: 'Data export',
text: 'Download CSV'
},
{
extend: 'pdfHtml5',
title: 'Sproglets Payment Report',
text: 'Download PDF',
pageSize: 'LEGAL',
customize: function (doc) {
doc.styles.tableHeader.alignment = 'left';
doc.content.forEach(function (item) {
if (item.table) {
item.table.widths = ['10%', '50%', '10%', '10%', '12%', '8%']
}
});
doc.content.splice(0, 0, {
margin: [0, 0, 0, 0],
alignment: 'center',
image: 'data:image/png;base64,image_url'
});
doc['footer'] = (function () {
return {
columns: [
{
alignment: 'center',
text: ['Copyrights are reserved by Sproglets']
}
],
margin: 20
}
});
},
}
],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment