JSFiddle - React, Tailwind, and code Playground
by taraVed
HTML
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/fixedcolumns/3.3.3/css/fixedColumns.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css">
<table id="example" class="stripe row-border order-column" width="100%">
<thead>
<tr>
<th>Drawing</th>
<th style="display:none">Overview</th>
<th>Stage</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>BW101-01</td>
<td>1</td>
<td> <button type="button" id="clarify" class="">Clarify</button>
<button type="button" id="allott" class="">Allott</button>
<p id="satge3">Started / Paused</p>
<button type="button" id="correctit" class="">correctit</button>
<button type="button" id="send" class="">send</button></td>
</tr>
<tr>
<td>BW102-02</td>
<td>2</td>
<td> <button type="button" id="clarify" class="">Clarify</button>
<button type="button" id="allott" class="">Allott</button>
<p id="satge3">Started / Paused</p>
<button type="button" id="correctit" class="">correctit</button>
<button type="button" id="send" class="">send</button></td>
</tr>
<tr>
<td>BW103-03</td>
<td>2</td>
<td> <button type="button" id="clarify" class="">Clarify</button>
<button type="button" id="allott" ...
JavaScript
$(document).ready(function(e) {
var table = $('#example').DataTable();
var Stage = 1; //i get this from database
alert(Stage);
if (Stage == 1) {
$("#allott").hide();
$("#clarify").show();
$("#satge3").hide();
$("#correctit").hide();
$("#send").hide();
} else if (Stage == 2) {
$("#allott").show();
$("#clarify").hide();
$("#satge3").hide();
$("#correctit").hide();
$("#send").hide();
} else if (Stage == 3) {
$("#allott").hide();
$("#clarify").hide();
$("#satge3").show();
$("#correctit").hide();
$("#send").hide();
} else if (Stage == 4) {
$("#allott").hide();
$("#clarify").hide();
$("#satge3").hide();
$("#correctit").show();
$("#send").hide();
} else if (Stage == 5) {
$("#allott").hide();
$("#clarify").hide();
$("#satge3").hide();
$("#correctit").hide();
$("#send").show();
}
});