JSFiddle - React, Tailwind, and code Playground
HTML
<table border='1'>
<thead>
<th></th>
<th>ID</th>
<th>Status</th>
</thead>
<tbody>
<tr class="grid-row ">
<td class="grid-cell" data-name="">
<button type="submit">Restart</button>
</td>
<td class="grid-cell" data-name="job_id">2349</td>
<td class="grid-cell" data-name="JobStatusName">Completed</td>
</tr>
<tr class="grid-row ">
<td class="grid-cell" data-name="">
<button type="submit">Restart</button>
</td>
<td class="grid-cell" data-name="job_id">6585</td>
<td class="grid-cell" data-name="JobStatusName">Error</td>
</tr>
<tr class="grid-row ">
<td class="grid-cell" data-name="">
<button type="submit">Restart</button>
</td>
<td class="grid-cell" data-name="job_id">4564</td>
<td class="grid-cell" data-name="JobStatusName">Processing</td>
</tr>
</tbody>
</table>
JavaScript
$(function() {
$('table tr').each(function() {
var Cell = $(this).find('td:eq(2)');
debugger;
if (Cell.text() !== 'Error') {
$(this).find('button').hide();
}
});
});