Datatable styling so bootstrap button appears on same row as other elements

后端 未结 6 2059
既然无缘
既然无缘 2021-01-30 01:41

I\'m using jQuery DataTables plugin and Bootstrap on my rails site. I can\'t get my custom button and other table header elements to nest in the same row, They are stacked inste

6条回答
  •  北海茫月
    2021-01-30 02:28

    You have to put two divs: one for the datatable buttons and other for your custom code

           var table = $("#tbl_oferta").dataTable({
                    dom: '<"pime-grid-button"B><"pime-grid-filter">frtip',
            ...
           });
    
           $("div.pime-grid-filter").html('Custom tool bar! Text/images etc.');
    

    Then define div class in your css:

    .pime-grid-button{float:left}
    .pime-grid-filter{float:left;margin-left:10px}        
    

    Sample Image

提交回复
热议问题