JSFiddle - React, Tailwind, and code Playground
by suit
HTML
<table border="1" rules="group">
<thead>
<tr>
<th>foo</th>
<th>bar</th>
<th>baz</th>
<th>qux</th>
<th>quux</th>
</tr>
</thead>
<tbody>
<tr>
<td>1.1</td>
<td>1.2</td>
<td>1.3</td>
<td>1.4</td>
<td>1.5</td>
</tr>
<tr>
<td colspan='2'>1.6</td>
<td colspan='3'>1.7</td>
</tr>
</tbody>
<tbody>
<tr>
<td>2.1</td>
<td>2.2</td>
<td>2.3</td>
<td>2.4</td>
<td>2.5</td>
</tr>
<tr>
<td colspan='2'>2.6</td>
<td colspan='3'>2.7</td>
</tr>
</tbody>
<tbody>
<tr>
<td>3.1</td>
<td>3.2</td>
<td>3.3</td>
<td>3.4</td>
<td>3.5</td>
</tr>
<tr>
<td colspan='2'>3.6</td>
<td colspan='3'>3.7</td>
</tr>
</tbody>
<tbody>
<tr>
<td>4.1</td>
<td>4.2</td>
<td>4.3</td>
<td>4.4</td>
<td>4.5</td>
</tr>
<tr>
<td colspan='2'>4.6</td>
<td colspan='3'>4.7</td>
</tr>
</tbody>
</table>
CSS
.ui-sortable-placeholder td {
background: red;
}
JavaScript
$("table").sortable({
items: 'tbody',
forcePlaceholderSize: true,
placeholder: {
element: function() {
return '<tbody class="ui-sortable-placeholder"><tr><td colspan="5">placeholder</td></tr></tbody>';
},
update: function(container, p) {
return;
}
},
helper: function(event, element) {
helper = element.clone();
$('td', helper).each(function(index) {
$(this).width($('td', element).eq(index).width());
});
return helper;
}
}).disableSelection();