[英]Scroll only showing part of the element
so am trying to make a table have a fixed size and horizontally scrollable, and I added overflow-x: auto;
所以我试图让一个表有一个固定的大小和水平滚动,我添加了
overflow-x: auto;
, but for some reason it only scrolling part of the table while the start of the table is outside of the screen, I am unable to show the code so here is a sample to make it clearer , 但由于某种原因它只滚动表格的一部分而表格的开头在屏幕之外,我无法显示代码所以这里是一个示例以使其更清晰
the green part can be scrolled normally but the scrollbar end it the red part, when I zoom out or add margin it appears, but that is not really a solution.绿色部分可以正常滚动,但滚动条结束红色部分,当我缩小或添加边距时,它会出现,但这并不是真正的解决方案。 The table is inside a flex container if that matters, but does not have anything applied on it.
如果重要的话,该表位于一个 flex 容器内,但没有应用任何内容。
thanks谢谢
try overflow-x: scroll;
尝试
overflow-x: scroll;
instead of overflow-x: auto;
而不是
overflow-x: auto;
So, I will try to guess your code as you could not share with some assumption and provides some steps may help:因此,我将尝试猜测您的代码,因为您无法与某些假设共享,并提供一些步骤可能会有所帮助:
otherwise, you should provide a small sample of your code to sort out the issue more clearly.否则,您应该提供一小部分代码示例,以便更清楚地解决问题。
justify-content: center
on your div if you have one.justify-content: center
on your div 如果你有一个。 i was having the same problem,then i found out that having justify-content: center
on the div was the one causing the issue.justify-content: center
在 div 上是导致问题的原因。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.