How to let buttons float at right top

How to let buttons float at right top

fc338339fc338339 Posts: 16Questions: 8Answers: 1

I need to make the buttons always float at top right corner below the menu bar,
should i write a class and how to apply it at below script ?

"buttons": [
{ extend: "create", editor: editor_1 },
{ extend: "edit", editor: editor_1 },
'colvis',{
extend: 'excelHtml5' ,
exportOptions: {
columns: ':visible'}
}
]

Answers

  • allanallan Posts: 61,452Questions: 1Answers: 10,055 Site admin

    You need to use a combination of the dom parameter and CSS. Bu default Buttons has:

    div.dt-buttons {
        position: relative;
        float: left;
    }
    

    In your CSS you would add an override:

    div.dt-buttons {
        float: right;
    }
    

    Depending on your dom option you may also need to move where the B option is included to have the elements appear in the correct order in the DOM.

    Allan

This discussion has been closed.