2016-11-03 321 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