2016-08-13 1 views
1

J'utilise la table jquery tablesorter dans mon application. Je veux ajouter une hauteur maximale pour le tbody et le scroll overflow.jquery tablesorter défilement vertical ne fonctionne pas

<table id="myTable" class="tablesorter"> 
<thead> 
<tr> 
    <th>Last Name</th> 
    <th>First Name</th> 
    <th>Email</th> 
    <th>Due</th> 
    <th>Web Site</th> 
</tr> 
</thead> 
<tbody> 
<tr> 
    <td>Smith</td> 
    <td>John</td> 
    <td>[email protected]</td> 
    <td>$50.00</td> 
    <td>http://www.jsmith.com</td> 
</tr> 

</tbody> 
</table> 

ajouter

.tablesorter thead{ 
display:block; 
} 
.tablesorter tbody{ 
    height: 200px; 
    overflow-y: auto; 
    overflow-x: hidden; 
    display: block ; 
} 

Mais sa ne prenant pas ... est-il possible d'ajouter cette fonctionnalité à TableTrie?

+0

désolé pour le point manquant, sa ne fonctionne pas toujours –

Répondre

0

Il vous manque . avant le nom de classe de la table.

Votre code CSS devrait ressembler à ceci,

.tablesorter thead{ 
display:block; 
} 
.tablesorter tbody{ 
    height: 200px; 
    overflow-y: auto; 
    overflow-x: hidden; 
    display: block ; 
} 

Il devrait être .tablesorter tbody au lieu de tablesorter tbody.

Demo: (.) ​​https://jsfiddle.net/ybb7aw47/