JSFiddle - React, Tailwind, and code Playground
by Jake Wolpert
HTML
<table class="table table-hover table-striped">
<thead>
<tr>
<th>
Drag Button
</th>
<th>
Number
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody id="sortable">
<tr>
<td class="ui-state-default drag-handler" data-taskid="1"></td>
<td>1</td>
<td>Description item 1</td>
</tr>
<tr>
<td class="ui-state-default drag-handler" data-taskid="2"></td>
<td>2</td>
<td>Description item 2</td>
</tr>
<tr>
<td class="ui-state-default drag-handler" data-taskid="3"></td>
<td>3</td>
<td>Description item 3</td>
</tr>
</tbody>
</table>
CSS
body {
font-size: 14px;
}
.drag-handler {
width: 8em;
position: relative;
background-color: #E4E6EB;
background-image: linear-gradient(45deg, #E4E6EB, #E4E6EB 2px, #fff 2px, #fff 4px, #E4E6EB 4px, #E4E6EB 9px, #fff 9px, #fff 11px, #E4E6EB 11px, #E4E6EB 16px, #fff 16px, #fff 18px, #E4E6EB 18px, #E4E6EB 22px);
background-size: 10px 20px;
cursor: move;
border-top: 2px solid #FFF;
border-bottom: 2px solid #FFF;
}
.drag-handler:active {
background-image: linear-gradient(45deg, #bab86c, #bab86c 2px, #fff 2px, #fff 4px, #bab86c 4px, #bab86c 9px, #fff 9px, #fff 11px, #bab86c 11px, #bab86c 16px, #fff 16px, #fff 18px, #bab86c 18px, #bab86c 22px);
background-size: 10px 20px;
}
JavaScript
$(document).ready(function() {
$("#sortable").sortable({
handle: ".drag-handler"
});
$("#sortable").disableSelection();
});