ccc

JQueryui: Datatables con sortable

<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">
        <link rel="stylesheet" type="text/css" href="http://cdn.datatables.net/1.10.4/css/jquery.dataTables.min.css">
        <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
        <script src="http://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
        <script type="text/javascript" language="javascript" src="http://cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js"></script>
    </head>
<body>

<table id="tablaLSG" class="table table-striped table-bordered" style="width:800px;">
    <thead>
      <tr>
          <th>CAB 1</th>
          <th>CAB 2</th>
      </tr>
    </thead>
    <tbody>
        <tr>
            <td>1</td>
            <td>2</td>
        </tr>
        <tr>
            <td>3</td>
            <td>4</td>
        </tr>
        <tr>
            <td>5</td>
            <td>6</td>
        </tr> 
    <tbody>   
</table>​

<script>
$(document).ready(function() {
    $('tbody').sortable();
});
</script>

</body>
</html>

No hay comentarios:

Publicar un comentario