I have followed the steps on Individual column searching (text inputs) and Individual column searching (select inputs) to use multiple filters on jQuery DataTable and there are multiple filters on the footer. On the other hand, I want to move these filters to the header of the DataTable, but cannot align them horizontally as displayed on the image below. There are some examples as Custom filtering - range search, but they are not aligned as well. Is it possible to do this?
$(document).ready(function() {
// Setup - add a text input to each footer cell
$('#example tfoot th').each( function () {
var title = $(this).text();
$(this).html( '<input type="text" placeholder="Search '+title+'" />' );
} );
// DataTable
var table = $('#example').DataTable();
// Apply the search
table.columns().every( function () {
var that = this;
$( 'input', this.footer() ).on( 'keyup change', function () {
if ( that.search() !== this.value ) {
that
.search( this.value )
.draw();
}
} );
} );
} );
this can be achived by css.
Here
solution
to your problem please add necessary things datatable configuration.Column filter is moved from footer to table header by using CSS, i.e. just by using
https://jsfiddle.net/dipakthoke07/ehhfsrfq/2/
Hope this help you.
You may try this DataTables plug-in, looks like it fits to the purpose, though interface is somewhat different from what you required.
Here solution for individual column search in data Table. it also use for multiple row value search using regex :