Jquery UI Sortable, move two tables together

Jquery UI Sortable, move two tables together

I want to change order of some tables between them (tables, not rows). My code is more complex than I'll show you here, but as an example I will try to give you a short example.

  1. <table class="table-A">
        <td><div>Move button</div></td>
    </table>
    <table class="table-A-next">
        .....
    </table>

    <table class="table-B">
        <td><div>Move button</div></td>
    </table>
    <table class="table-B-next">
        .....
    </table>


I want to move table-A and table-A-next (in the same time - together), with the button from table-A, after table-B-next (not after table-B).

PS: I know there are a lot examples, but not at mine and not with tables. I don't want to change my html structure...

Thank you.