New user questions

New user questions

PeteHPeteH Posts: 4Questions: 2Answers: 0

Just started using DataTables and like what I see so far but have a few questions.

How can I position the Search input field at the left of my table not the right, style it as a bootstrap input group, remove the "Search" label, and add placeholder text?

I'm curious as to why I am able to use the fixed header feature even though I did not include when I configured my CDN.

I configured my CDN to include buttons including the Excel button, copied the example js code to show the button but no button appears. This is using Chrome 81.0.4044.138 on OSX 10.14.6 Here's my js:

$(document).ready(function() {
    $('#historytable').DataTable( {
        buttons: [
            'excel'
      ],
        "scrollY":        "600px",
        "scrollCollapse": true,
        "paging":         false,
         "info": false
    } )
} );

Answers

  • kthorngrenkthorngren Posts: 20,276Questions: 26Answers: 4,765

    How can I position the Search input field at the left of my table not the right, style it as a bootstrap input group, remove the "Search" label, and add placeholder text?

    You can use the dom option to place the Datatables elements where you like. Here are a couple threads that discuss styling with input-groups.
    https://datatables.net/forums/discussion/comment/52857/#Comment_52857
    https://datatables.net/forums/discussion/36267

    Out of curiosity I tried the second thread's solution here:
    http://live.datatables.net/pufureqe/1/edit

    I'm curious as to why I am able to use the fixed header feature even though I did not include when I configured my CDN.

    Hmm, that seems strange. Are you sure its not a concatenated file with FixedHeader combined with Datatables? Open the JS file to see what is included in the file. If its a concatenated file it will list all the extension included. Or maybe you have something else providing a fixedheader like solution. I don't see it enabled in your config. Can you provide a link to your page or a test case so we can see what is happening?
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    I configured my CDN to include buttons including the Excel button, copied the example js code to show the button but no button appears. This is using Chrome 81.0.4044.138 on OSX 10.14.6 Here's my js:

    This doc shows the options you can use to display the buttons.

    Kevin

  • PeteHPeteH Posts: 4Questions: 2Answers: 0

    Thanks, I'll try your suggestions.

This discussion has been closed.