2016-09-28 15 views
0

有一个与我的表中的错误,你可以在这个图像上看到:细胞具有溢出不能保持色平板

enter image description here

每一行都有一个颜色(它们都是绿色在这里),但具有溢出(滚动)的单元格似乎在保持单元格颜色方面存在问题。 你可以注意到一些奇怪的东西:颜色在桌子下面(“Légende”按钮所在的位置)。

我的CSS的一部分:

table { 
    table-layout: fixed; 
    width: 100%; 
} 

table tr td{ 
    overflow: scroll; 
    overflow-y: hidden; 
    overflow-x: auto; 
    white-space: nowrap; 
} 

td::-webkit-scrollbar-thumb { 
    -webkit-border-radius: 2px; 
    -webkit-box-shadow: inset 0 0 2px rgba(0,0,0,0.5); 
    background: transparent; 
} 

td::-webkit-scrollbar-thumb:window-inactive { 
    background: rgba(255,255,255,0.3); 
} 

td::-webkit-scrollbar-track { 
    background: transparent; 
    border: 0; 
} 

::-webkit-scrollbar-corner { 
    background: transparent; 
} 

::-webkit-scrollbar { 
    width: 8px; 
    height: 8px; 
} 

::-webkit-scrollbar-thumb:hover { 
    background: #838383; 
} 

::-webkit-scrollbar-thumb:active { 
    background: #6a6a6a; 
} 

tr { 
    background-color: rgb(xx, xx, xx); 
    display: tabl-row; 
} 

你知不知道,如果是我的CSS问题或错误,因为我是一个小屏幕上(平板电脑,使用Chrome)。在笔记本电脑屏幕上也没有问题(Chrome也是如此)。

回答

1

溢出滚动直接不能应用于td标签。因此,嵌套一个块级别的div与溢出:td标签内的滚动属性设置。就像这样:

<td><div style="overflow:scroll;">Content</div></td> 

您可以参考这个Similar problem here

+0

你是对的,我需要的TD标签内一个div。没有错误了!谢谢。 –