• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

float-head table

Markus92

Mitglied
Hallo,

Ich möchte gerne beim scrollen meiner Tabelle den Header immer sehen, dazu möchte ich jquery.floatthead verwenden. leider funktioniert es nicht.
Kann mir jemand sagen, woran es liegen könnte?

HTML:
<!DOCTYPE html>
<html lang="de">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=10; IE=9; IE=8; IE=7; IE=EDGE" />
        <title>Titel</title>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.js"></script>
        <script src="https://rawgithub.com/mkoryak/floatThead/master/dist/jquery.floatThead.min.js"></script>
        <script type="text/javascipt">
        $('table').floatThead({
            useAbsolutePositioning: false
        });
        </script>
     </head>
    <body>
        <div>
            <table border=1 style='empty-cells:show;' class="table floatThead-table">
                <thead>
                    <tr>
                        <th>1</th>
                        <th>2</th>
                        <th>3</th>
                        <th>4</th>
                        <th>5</th>
                        <th>6</th>
                        <th>7</th>
                        <th>8</th>
                        <th>9</th>
                        <th>10</th>
                        <th>11</th>
                        <th>12</th>
                        <th>13</th>
                        <th>14</th>
                        <th>15</th>
                        <th>16</th>
                        <th>17</th>
                    </tr>
                </thead>
                <tbody class="scrollContainer">
                    <?php
                    while($i<5)){
                        echo"
                            <tr>
                                <td>1</td>
                                <td>2</td>
                                <td>3</td>
                                <td>4</td>
                                <td>5</td>
                                <td>6</td>
                                <td>7</td>
                                <td>8</td>
                                <td>9</td>
                                <td>10</td>
                                <td>11</td>
                                <td>12</td>
                                <td>13</td>
                                <td>14</td>
                                <td>15</td>
                                <td>16</td>
                                <td>17</td>
                            </tr>
                        ";
                        $i++;
                    }
                    ?>
                </tbody>
            </table>
        </div>
    </body>
</html>
 
Werbung:
Werbung:
Zurück
Oben