How to modify the style and position of buttons autogenerated like pdf/excel/printer download?
How to modify the style and position of buttons autogenerated like pdf/excel/printer download?
joselacour
Posts: 3Questions: 2Answers: 0
Hi, I'm new to the forum and to the library and I have a question:
<script>
$(document).ready( function () {
$('#tableID').DataTable( {
"dom": '<"top"lf>t<"bottom"<B>ip>',
'buttons': [
'print',
'excel',
'pdf',
'colvis'
],
} );
} );
</script>
I would like to be able to control the style and position of the buttons autogenerated by the library for example with the table above, which is already populated, and I would like to know how to do it, I read the documentation but it was not very clear to me, sorry if it is a very basic question
This question has an accepted answers - jump to answer
Answers
Use the Direct insertion method to place the buttons where you want. You will need to remove the
B
from thedom
option. Usebuttons.buttons.className
to define a class that can be used to define the styling you want.Kevin
Thank you very much for the help! whit your help and this example of a similar aswer:
https://live.datatables.net/jejurije/37/edit
I did it! thank you!