I'm wondering how to use the jQuery sortable.
I have to block so that the user never puts a tr
on th
2º Notice that when you drag a place line the data is all stuck together, how do you keep the columns separated?
$(document).ready(function () {
$('tbody').sortable();
});
.tab_dados {
width: 100%;
border-collapse: collapse;
text-align: center;
}
.tab_dados a {
color: #484848;
text-decoration: none;
}
.tab_dados th {
background: #0091FF;
color:#FFFFFF;
font-style: italic;
}
.tab_dados tr {
height: 50px;
border-bottom: 1px solid #D5D5D5;
}
.tab_dados tr:nth-child(odd) {
background: #F7F7F7;
}
.tab_dados tr:nth-child(even) {
background: #FFFFFF;
}
.tab_dados tr:hover {
background: #F1F1F1;
}
tfoot tr td{
border:0;
height: 40px;
}
.tfoot{
width: 100%;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.js"></script>
<table class="tab_dados">
<tr>
<th style="width: 30px;"></th>
<th>CÓDIGO</th>
<th>NOME</th>
<th>CIDADE</th>
<th>ESTADO</th>
</tr>
<tr id='2'>
<td> </td>
<td>25</td>
<td>HUGO</td>
<td>BOA ESPERANÇA</td>
<td>MG</td>
</tr>
<tr id='3'>
<td> </td>
<td>26</td>
<td>bruno</td>
<td>BOA ESPERANÇA</td>
<td>MG</td>
</tr>
<tr>
<td> </td>
<td>27</td>
<td>rafael</td>
<td>BOA ESPERANÇA</td>
<td>MG</td>
</tr>
</table>