Gerald: Tip/Vorschlag gesucht

Beitrag lesen

Meine Lösung sollte für tr und thead-Sortierung funktionieren und ist zudem sogar kürzer :p

Läuft bei mir aber  nicht :-(

Kannst Du mal drüber schauen?

Gruß, Gerald

  
<html>  
 <head>  
<script type="text/javascript" src="./jquery-1.8.2.js"></script>  
<script type="text/javascript" src="./jquery-ui-1.9.0.custom.min.js"></script>  
 </head>  
 <body>  
<script>  
$("table").sortable({  
    items: 'tbody',  
    helper:  function(event, element) {  
        helper = element.clone();  
  
        $('td', helper).each(function(index) {  
            $(this).width($('td', element).eq(index).width());  
        });  
  
        return helper;  
    }  
}).disableSelection();  
</script>  
  
  
<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>  
 </body>  
</html>