I have the following table and I would like you to click on a button to hide some rows based on a condition in the value you have
<table class="uk-table" id="mitabla">
<thead>
<tr>
<th>
Oficina
</th>
<th>
Numero de Oficina
</th>
<th>
Turno
</th>
<th>
Status
</th>
<th>
tipo de tramite
</th>
<th>
Acción
</th>
</tr>
</thead>
<tbody id="body_tramites">
<?php
while ($mostrar=mysqli_fetch_row($result)) {
?>
<tr>
<td><?php echo $mostrar[0]?></td>
<td><?php echo $mostrar[1]?></td>
<td><?php echo $mostrar[2]?></td>
<?php
$cron= $mostrar[3];
if($cron<$time){
echo "<td class=\"verde\">".$cron."</td>" ;
}
elseif($cron>$time){
echo "<td class=\"rojo\">".$cron."</td>" ;
} ?>
<td><?php echo $mostrar[4]?></td>
<td><i data-toggle="modal" data-target="#modal_comprobacion" class="material-icons uk-text-primary md-icon uk-form-file" >search</i></td>
</tr>
<?php
}
?>
</tbody>
</table>
I tried this:
$('#mostrarVencidos').click(function() {
$("table tr td").each(function() {
var tiempo = "00:00:30";
var celda = $.trim($(this).text());
if (celda < tiempo) {
$(this).parent().hide();
}
});
});
$('#mostrarEnTiempo').click(function() {
$("table tr td").each(function() {
var tiempo = "00:00:30";
var celda = $.trim($(this).text());
if (celda > tiempo) {
$(this).parent().hide();
}
});
});
WITHOUT SUCCESS: In #showthroughs if you show me correctly and in the other hide all