jQuery DataTables - 单击列时排序不起作用

The tabs/search bar/page entries appear at the top of the table as expected. But they are not sorted when clicked. It's like it only looks at the first row.

<script>

    $(document).ready( function () {

    $('#aeotable').DataTable();

    } );

</script>

echo '

    <table id="aeotable" class="display">
            <thead>     
                <tr>
                    <th>Company Name</th>
                    <th>Expiry insurance certificate</th>
                    <th>Comments</th>
                    <th>File Name</th>
                    <th>&nbsp;</th>
                </tr>
            </thead>';



    // Print each file
    while($row = $result->fetch_assoc()) {
        echo "
        <tbody>
            <tr>
                <td>{$row['cop']}</td>
                <td>{$row['expo']}</td>
                <td>{$row['dec']}</td>
                <td>{$row['fil']}</td>
                <td><a download href=\"file/{$row['file']}\">Download</a></td>


            </tr>
        </tbody>";
    }

    // Close tabl
    echo '</table>';

You are creating a <tbody> for each row instead of one <tbody> for all rows.

Change to

echo '<tbody>';
// Print each file
while($row = $result->fetch_assoc()) {
    echo "        
        <tr>
            <td>{$row['cop']}</td>
            <td>{$row['expo']}</td>
            <td>{$row['dec']}</td>
            <td>{$row['fil']}</td>
            <td><a download href=\"file/{$row['file']}\">Download</a></td>
        </tr>";
} 

echo ' </tbody>';