I have 2 buttons CSV and PDF on my datatable and they seem to be very close to me. I need help on adding some space between them. I tried using ‘spacer’ button as per https://datatables.net/extensions/buttons/examples/initialisation/spacer.html but nothing works.
Following is my code:
buttons: [
{
extend: 'csv',
title: 'Lock Logs for @Model.LockName',
filename: function () {
var filename = 'Lock Logs for @Model.LockName ';
var dt = new Date();
var currentdatetime = dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate() + '_' + dt.getHours() + '-' + dt.getMinutes() + '-' + dt.getSeconds();
return filename + currentdatetime;
}
},
{
extend: 'pdf',
title: 'Lock Logs for @Model.LockName',
filename: function () {
var filename = 'Lock Logs for @Model.LockName ';
var dt = new Date();
var currentdatetime = dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate() + '_' + dt.getHours() + '-' + dt.getMinutes() + '-' + dt.getSeconds();
return filename + currentdatetime;
}
}
]
Below are my scripts that i am using:
<link rel="stylesheet" type="text/css" href="~/Scripts/DataTables/media/css/jquery.dataTables.css">
<script type="text/javascript" src="~/Scripts/DataTables/media/js/jquery.dataTables.js"></script>
<link rel="stylesheet" type="text/css" href="~/Scripts/DataTables/extensions/Responsive/css/responsive.dataTables.css">
<script type="text/javascript" src="~/Scripts/DataTables/extensions/Responsive/js/dataTables.responsive.js"></script>
<script type="text/javascript" src="~/Scripts/pdfmake.min.js"></script>
<script type="text/javascript" src="~/Scripts/vfs_fonts.js"></script>
<script type="text/javascript" src="~/Scripts/DataTables/extensions/Buttons/js/dataTables.buttons.js"></script>
<script type="text/javascript" src="~/Scripts/DataTables/extensions/Buttons/js/buttons.bootstrap.js"></script>
<script type="text/javascript" src="~/Scripts/DataTables/extensions/Buttons/js/buttons.html5.js"></script>