New user questions
New user questions
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
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
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
This doc shows the options you can use to display the buttons.
Kevin
Thanks, I'll try your suggestions.