JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<div id="tabs">
<div class="col-md-12">
<div id="table1">
<table class="table">
<thead>
<tr>
<th class="thcenter">ID</th>
<th class="thcenter">Visible</th>
<th class="thcenter">Nombre</th>
<th class="thcenter">Header</th>
<th class="thcenter">Home</th>
<th class="thcenter">Orden</th>
<th class="thcenter"><span class="glyphicon glyphicon-cog"></span>Acciones</th>
</tr>
</thead>
<tbody id="tbodyproject">
<tr id="id1" class="trdrag">
<td class="idrow tdcenter"><p id="margindata">1</p></td>
<td class="hidden-td" >Testing</td>
<td class="hidden-td">Testing2</td>
<td class="tdcenter tdvisible">
Yes
</td>
<td class="tdslug"><p id="margindata">Slug</p></td>
<td class="tdimg"><img src="http://via.placeholder.com/350x150" class="sizeheader"></td>
<td class="tdimg"><img src="http://via.placeholder.com/350x150" class="sizehome"></td>
<td class="tdcenter tdorder"><p id="margindata">Order 1</p></td>
<td class="tdacciones">
<form method="POST" action="{{route('admin.projects.destroy',$project->id)}}" onsubmit="return ConfirmarBorrar()">
<a href="#" class="btn btn-success btn-sm" id="margindata">Edit</a>
<input type="submit" value="Delete" class="btn btn-danger btn-sm" id="margindata">
<input...
CSS
img {
width: 100px;
}
.hidden-td{
display:none;
}
.table{
background-color:green;
border:0;
}
.trdrag{
background-color:yellow;
}
.thcenter{
background-color:grey !important;
}
.ui-sortable-helper {
left:0px!important;
}
.idrow{
width:5%;
}
.tdvisible{
width:5%;
}
.tdslug{
width:10%;
}
.tdimg{
width:15%;
}
.tdorder{
width:20%;
}
.tdacciones{
width:40%;
}
JavaScript
$("#tabs").tabs();
$("#tbodyproject").sortable({
items: "> tr",
appendTo: "parent",
helper: "clone",
placeholder: "placeholder-style",
start: function(event, ui) {
$(this).find('.placeholder-style td:nth-child(2)').addClass('hidden-td')
ui.helper.css('display', 'table')
},
stop: function(event, ui) {
ui.item.css('display', '')
},
update: function( event, ui ) {
let newOrder = $(this).sortable('toArray');
$.ajax({
type: "POST",
url:'/admin/projects/updateOrder',
data: {ids: newOrder}
})
.done(function( msg ) {
location.reload();
});
}
}).disableSelection();