2016-11-03 323 views
-1

在cakephp3中,我有很多數據要顯示爲100行。我希望數據顯示在滾動框中,因此一次只顯示10行,但您可以向下滾動並查看其餘數據。我不想爲此分頁作爲解決方案。我無法找到這個將垂直滾動條添加到cakephp3

的例子下面是一個用來顯示數據的代碼,我想用滾動條

<div class="form-group col-md-12 col-xs-12 col-sm-12"> 
    <div class="table-responsive"> 
    <table class="table table-striped table-bordered table-hover"> 
     <thead> 
     <tr> 
      <th>Id</th> 
      <th> Name</th> 
      <th> Email</th> 
      <th>Select</th> 
     </tr> 
    </thead> 
    <tbody> 
    <?php foreach ($resumes as $key => $resume) { ?> 
     <tr> 
     <td><?php echo $resume['id'] ?></td> 
     <td><?= $resume['first_name'] .' '. $resume['last_name']; ?>&nbsp;</td> 
     <td><?php echo $resume['email']//.'<br> '. $resume['mobile']; ?></td> 


?> 

........

+0

你究竟需要什麼來更好地理解這個問題?如果我無法找到答案,那麼在迴應中展示一些努力而不是倒退是更有建設性的。我剛從這裏開始,所以這真的是作爲拖釣! – jagguy

+0

這可能對您有所幫助:[http://rocha.la/jQuery-slimScroll/](http://rocha.la/jQuery-slimScroll/) –

回答

0

添加此數據只是把你表格在一個div中,並使該div有一個固定的高度和overflow-y屬性。並在你的表格中,我建議你使用蛋糕方式$this->Html->tableHeaders$this->Html->tableCells