JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css">
<div>
<h1>
first
</h1>
<table id="firstOne">
<thead>
<tr>
<th>fname</th>
<th>lname</th>
</tr>
</thead>
<tbody>
<tr>
<td>Jean-Guy</td>
<td>Citroën</td>
</tr>
<tr>
<td>Dany</td>
<td>Dubé</td>
</tr>
<tr>
<td>Jérôme</td>
<td>St-Pierre</td>
</tr>
</tbody>
</table>
</div>
<div>
<h2>
Second
</h2>
<table id="secondOne">
<thead>
<tr>
<th>fname</th>
<th>lname</th>
</tr>
</thead>
<tbody>
<tr>
<td>Jean-Guy</td>
<td>Citroën</td>
</tr>
<tr>
<td>Dany</td>
<td>Dubé</td>
</tr>
<tr>
<td>Jérôme</td>
<td>St-Pierre</td>
</tr>
</tbody>
</table>
</div>
<br><br><br>
CSS
div {
margin-bottom:15px;
padding:5px;
background:#ccc;
}
JavaScript
$(document).ready(function(){
// first datatable setup
var firstDt = $("#firstOne").dataTable();
$(".dataTables_filter input").keyup(function(){
firstDt.search(
jQuery.fn.DataTable.ext.type.search.string( this.value )
)
.draw()
});
// second datatable setup
var secondDt = $("#secondOne").dataTable();
$(".dataTables_filter input").keyup(function(){
secondDt.search(
jQuery.fn.DataTable.ext.type.search.string( this.value )
).draw()
});
}); // end ready
//replace function
jQuery.fn.DataTable.ext.type.search.string = function ( data ) {
return ! data ?
'' :
typeof data === 'string' ?
data
.replace( /έ/g, 'ε' )
.replace( /[ύϋΰ]/g, 'υ' )
.replace( /ό/g, 'ο' )
.replace( /ώ/g, 'ω' )
.replace( /ά/g, 'α' )
.replace( /[ίϊΐ]/g, 'ι' )
.replace( /ή/g, 'η' )
.replace( /\n/g, ' ' )
.replace( /á/g, 'a' )
.replace( /é/g, 'e' )
.replace( /í/g, 'i' )
.replace( /ó/g, 'o' )
.replace( /ú/g, 'u' )
.replace( /ê/g, 'e' )
.replace( /î/g, 'i' )
.replace( /ô/g, 'o' )
.replace( /è/g, 'e' )
.replace( /ï/g, 'i' )
.replace( /ü/g, 'u' )
.replace( /ã/g, 'a' )
.replace( /õ/g, 'o' )
.replace( /ç/g, 'c' )
.replace( /ì/g, 'i' ) :
data;
};