not able to change css position of single button from collection of buttons.
not able to change css position of single button from collection of buttons.
Hi,
i have added all buttons to my html page.I want to display column visibility and page no. buttons on top of the table while keeping others at bottom,but when I tried to change position of those 2 buttons,all other get affected.
My code is as;
`<html>
<head>
All js and css files
<style>
</head>
<body>
No | Name | Position | Office | Age | Start date | Salary |
---|---|---|---|---|---|---|
No | Name | Position | Office | Age | Start date | Salary |
1 | Tiger Nixon | System Architect | Edinburgh | 61 | 2011/04/25 | $320,800 |
2 | Garrett Winters | Accountant | Tokyo | 63 | 2011/07/25 | $170,750 |
3 | Ashton Cox | Junior Technical Author | San Francisco | 66 | 2009/01/12 | $86,000 |
4 | Cedric Kelly | Senior Javascript Developer | Edinburgh | 22 | 2012/03/29 | $433,060 |
5 | Airi Satou | Accountant | Tokyo | 33 | 2008/11/28 | $162,700 |
6 | Brielle Williamson | Integration Specialist | New York | 61 | 2012/12/02 | $372,000 |
7 | Herrod Chandler | Sales Assistant | San Francisco | 59 | 2012/08/06 | $137,500 |
8 | Rhona Davidson | Integration Specialist | Tokyo | 55 | 2010/10/14 | $327,900 |
9 | Colleen Hurst | Javascript Developer | San Francisco | 39 | 2009/09/15 | $205,500 |
10 | Sonya Frost | Software Engineer | Edinburgh | 23 | 2008/12/13 | $103,600 |
11 | Jena Gaines | Office Manager | London | 30 | 2008/12/19 | $90,560 |
12 | Quinn Flynn | Support Lead | Edinburgh | 22 | 2013/03/03 | $342,000 |
13 | Charde Marshall | Regional Director | San Francisco | 36 | 2008/10/16 | $470,600 |
14 | Haley Kennedy | Senior Marketing Designer | London | 43 | 2012/12/18 | $313,500 |
15 | Tatyana Fitzpatrick | Regional Director | London | 19 | 2010/03/17 | $385,750 |
16 | Michael Silva | Marketing Designer | London | 66 | 2012/11/27 | $198,500 |
17 | Paul Byrd | Chief Financial Officer (CFO) | New York | 64 | 2010/06/09 | $725,000 |
18 | Gloria Little | Systems Administrator | New York | 59 | 2009/04/10 | $237,500 |
19 | Bradley Greer | Software Engineer | London | 41 | 2012/10/13 | $132,000 |
20 | Dai Rios | Personnel Lead | Edinburgh | 35 | 2012/09/26 | $217,500 |
21 | Jenette Caldwell | Development Lead | New York | 30 | 2011/09/03 | $345,000 |
<script>
$(document).ready(function(){
var table= $('#example').DataTable( {
"pagingType":"full_numbers",
select: true,
fixedHeader: {
header: true,
},
colReorder: true,
fixedColumns: {
leftColumns: 0
},
rowReorder: true,
"sDom": 'W<"clear">frtipB',
lengthMenu: [
[ 10, 25, 50, -1 ],
[ '10 rows', '25 rows', '50 rows', 'Show all' ],
],
buttons: [
{
extend:'pageLength',
text: '<i class="fa fa-list-ol" aria-hidden="true" style="color:blue"></i>',
titleAttr: 'show no.of rows'
},
{
extend: 'colvis',
text: '<i class="fa fa-columns" aria-hidden="true" style="color:blue"></i>',
titleAttr: 'Column Visibility',
exportOptions: {
columns: ':visible',
}
},
{
extend: 'print',
text: '<i class="fa fa-print" aria-hidden="true" style="color:blue"></i>',
titleAttr: 'Print',
exportOptions: {
columns: ':visible',
modifier: {
page: 'current'
}
}
},
{
extend: 'pdfHtml5',
text: '<i class="fa fa-file-pdf-o" style="color:red"></i>',
titleAttr: 'PDF',
exportOptions: {
columns: ':visible',
modifier: {
page: 'current'
}
}
},
{
extend: 'excelHtml5',
text: '<i class="fa fa-file-excel-o" style="color:green"></i>',
titleAttr: 'Excel',
exportOptions: {
columns: ':visible'
}
},
{
extend: 'copyHtml5',
text: '<i class="fa fa-files-o" style="color:green"></i>',
titleAttr: 'Copy',
exportOptions: {
modifier: {
page: 'current'
}
}
},
{
extend: 'csvHtml5',
text: '<i class="fa fa-file-text-o" style="color:green"></i>',
titleAttr: 'CSV',
exportOptions: {columns: ':visible',
modifier: {
page: 'current'
}
}
},
],
scrollY: true,
deferRender: true,
scrollX: true,
scrollCollapse: true,
} );
});
</script>
</body>
</html>
`
Thanks.