Can I move the search box to the left?
Can I move the search box to the left?
amarundo
Posts: 6Questions: 3Answers: 0
Hi,
Using the Bootstrap styling...
Can I move the search box to the left?
And once I do that, can I remove the word "Search" and the colon?
And once I do that, maybe add placeholder text inside the box?
Thanks!
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
DOM feature to position the search box here -
https://datatables.net/reference/option/dom
Placeholder, search value described here -
https://datatables.net/reference/option/language.searchPlaceholder
Thanks, very useful.
this is kind of useful, but is there a way to move the search box to the left if I'm not using bootstrap styling?
Thanks
Yes you can make a class in your css like:
.pull-left{
float: left !important;
}
and then add this class to datatable search div using jquery or javascript.
example:
$('.dataTables_filter').addClass('pull-left');
make sure your script is in the head part of your html.
Thanks!
I found that adding:
.dataTables_filter {
text-align: left !important;
}
to the css also works.
Like countershane's last example, the simplest solution for me, too, was to just add his 3 lines to the CSS, BUT replace text-align with float: