2017-04-12 41 views
0
<div class="service-table"> 
    <table class="table"> 
     <thead> 
      <th>Title</th> 
      <th>Title</th> 
     </thead> 
     <tbody> 
      <tr> 
       <td>Text</td> 
       <td>Text</td> 
      </tr> 
     </tbody> 
    </table> 
</div> 

我有一個表與這個Bootstrap類。這是我的div CSS:溢出自動和高度在手機上的鉻不工作

.service-table { 
    height: 100px; 
    overflow: auto; 
    text-align: center; 
} 

我試圖修復高度,如果表的高度高於100px並顯示滾動條。在其他瀏覽器的桌面或移動設備上,這很好(在桌面版Chrome上也不錯)。但在移動版Chrome上,滾動條不會顯示,因此高度不是100像素。

+0

我添加了更多行到您的表,使其超過100px的高度,它的工作原理如下:http://jsbin.com/rarayurina/edit?html,css,output –

+0

我會在電話上測試謝謝你:) – Volkan

+0

適用於我的手機。測試全屏在這裏:http://output.jsbin.com/rarayurina/quiet –

回答

0

我在表格中添加了更多的行,使其高度超過100px,並且按預期工作:See my comment