JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="search" placeholder="Type to search">
<table id="table">
<tr>
<th>Naam -</th>
<th>Product -</th>
<th>Locatie</th>
</tr>
<tr>
<td>Henk</td>
<td>Laptop</td>
<td>Utrecht</td>
</tr>
<tr>
<td>Klaas</td>
<td>Beamer</td>
<td>Gorinchem</td>
</tr>
<tr>
<td>Sjaan</td>
<td>Opnameapparatuur</td>
<td>Gorinchem</td>
</tr>
</table>
CSS
body {
padding: 20px;
}
input {
margin-bottom: 5px;
padding: 2px 3px;
width: 209px;
}
td {
padding: 4px;
border: 1px #CCC solid;
width: 100px;
}
JavaScript
$(function(){
var $rows = $('#table tr');
$('#search').keyup(function () {
var val = '^(?=.*\\b' + $.trim($(this).val()).split(/\s+/).join('\\b)(?=.*\\b') + ').*$',
reg = RegExp(val, 'i'),
text;
$rows.show().filter(function () {
text = $(this).text().replace(/\s+/g, ' ');
return !reg.test(text);
}).hide();
});
});