Hide table scrollbar
Asked Answered
P

4

6

After some researches I found out that I have to set the tbody of a table

display: block;
overflow: auto;

to enable scrolling on a html table.

Is there a possibility to hide the scrollbar generic on every modern browser (Chrome, Safari, Firefox)? I tried some solutions like this one but it doesn't work on a table.

Pentheam answered 13/4, 2015 at 13:40 Comment(3)
have you tried overflow: none;Goy
But my aim is that the table is scrollable and the scrollbars are't visible. When I am apply overflow: none; to the tbody it doesn't work.Pentheam
Can you post fiddle with your problem? Hard to solve something I can't see.Goy
B
5

Use overflow: hidden; to hide the content outside of the container, or overflow: visible; to display it even if it's going outside of the container borders. Both remove the scrollbar.

Bertabertasi answered 13/4, 2015 at 13:45 Comment(1)
Or maybe you want something like this: #16671431 ?Bertabertasi
V
1

You can remove scrollbar easily by using the following CSS class:

.overflow-hidden {
    overflow: hidden;
}

If you are using Bootstrap just use overflow functionality. Find docs here

<div class="overflow-hidden">...</div>
Vandyke answered 17/3, 2020 at 3:32 Comment(0)
B
1

Just add the next css code

/* width */
::-webkit-scrollbar {
    width: 15px;
}

/* Track */
::-webkit-scrollbar-track {
    border-radius: 5px;
}

/* Handle */
::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 10px;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
    background: transparent;
}

We hope this help

Braggart answered 24/8, 2022 at 23:54 Comment(0)
B
0

.hideScrollbar::-webkit-scrollbar{
  display: none; 
 }
<div class='hideScrollbar'></div>
Bierman answered 29/7, 2020 at 5:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.