Change List length to Button length in custom first row
Change List length to Button length in custom first row
![John Dow](https://secure.gravatar.com/avatar/7f828c1d53a3821fcb131fc30c2d52e3/?default=https%3A%2F%2Fvanillicon.com%2F7f828c1d53a3821fcb131fc30c2d52e3_200.png&rating=g&size=120)
I have a custom first row template (three parts), thanks Kevin. Using this I get that the button is above the row. How to put a new button in
dom: "<'row'<'col-sm-12 col-md-3'**HERE**><'col-sm-12 col-md-6'f><'col-sm-12 col-md-3'B>>"
It is my code:
var table = new DataTable('#example', {
dom: "<'row'<'col-sm-12 col-md-3'l><'col-sm-12 col-md-6'f><'col-sm-12 col-md-3'B>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>",
buttons: [
'copy', 'excel'
]
} );
new $.fn.dataTable.Buttons( table, {
buttons: [
'pageLength'
]
} );
table.buttons( 1, null).container().prependTo(
table.table().container()
);
This question has an accepted answers - jump to answer
Answers
Take a look at the
dom
Markup docs to see how to add an ID to one of thediv
elements. Add the ID and change line 19 to use that ID as the selector. For example:https://live.datatables.net/hawubena/4/edit
Kevin
Thank you Kevin, I learned a lot from you! It is work!