JSFiddle - React, Tailwind, and code Playground
HTML
<table id="data-table-command" class="table table-striped table-vmiddle">
<thead>
<tr>
<th data-column-id="name" data-order="desc">Name</th>
<th data-column-id="commands" data-formatter="commands" data-sortable="false">Control</th>
</tr>
</thead>
<tbody>
<?php
$user_query = "SELECT name FROM serv";
$results = $mysqli->query($user_query);
while ($row = $results->fetch_assoc()) {
?>
<form name="edit" action="formtest2.php" method="post">
<tr>
<td><?php
echo $row["name"];
?></td>
</tr>
</form>
<?php
}
$results->free();
?>
</tbody>
</table>
JavaScript
$(document).ready(function(){
//Command Buttons
$("#data-table-command").bootgrid({
caseSensitive: false,
css: {
icon: 'zmdi icon',
iconColumns: 'zmdi-view-module',
iconDown: 'zmdi-expand-more',
iconRefresh: 'zmdi-refresh',
iconUp: 'zmdi-expand-less'
},
formatters: {
"commands": function(column, row) {
return "<button type=\"submit\" class=\"btn btn-icon command-edit waves-effect waves-circle\" data-row-id=\"" + row.id + "\"><span class=\"zmdi zmdi-edit\"></span></button> ";
}
}
});
});