I am trying to create a table with vertical scrolling for the entire table content. Additionally, I need two columns within the table to be scrollable horizontally, but the horizontal scrollbars disappear when the vertical scrollbar is present. How can I keep both vertical and horizontal scrollbars visible at all times?
For reference, here is an example on JSFiddle: Fiddle Example
https://i.sstatic.net/zpGqwz5n.png
#data {
background: grey;
overflow: hidden;
display: flex;
flex-direction: column;
height: 400px;
width: 500px;
}
#splitter {
display: flex;
flex-direction: row;
background: darkgrey;
overflow-x: hidden;
overflow-y: auto;
align-items:start;
}
#right-content {
background: Gainsboro;
overflow-x: auto;
overflow-y: hidden;
}
#left-content {
background: Gainsboro;
overflow-x: auto;
overflow-y: hidden;
}
div {
margin: 10px;
}
p {
padding: 2px;
margin: 0px;
}
<div id="data">
<div id="splitter">
<div id="left-content">
<p>LeftColumnLeftColumn</p>
<p>LeftColumnLeftColumn</p>
<p>LeftColumnLeftColumn</p>
<p>LeftColumnLeftColumn</p>
<p>LeftColumnLeftColumn</p>
<p>LeftColumnLeftColumn</p>
<p>LeftColumnLeftColumn</p>
<p>LeftColumnLeftColumn</p>
<p>LeftColumnLeftColumn</p>
<p>LeftColumnLeftColumn</p>
<p>LeftColumnLeftColumn</p>
<p>LeftColumnLeftColumn</p>
<p>LeftColumnLeftColumn</p>
<p>LeftColumnLeftColumn</p>
<p>LeftColumnLeftColumn</p>
<p>LeftColumnLeftColumn</p>
<p>LeftColumnLeftColumn</p>
<p>LeftColumnLeftColumn</p>
</div>
<div id="right-content">
<p>RightColumnWithLongTextThatShouldBeScrollableHorizontally</p>
<p>RightColumnWithLongTextThatShouldBeScrollableHorizontally</p>
<p>RightColumnWithLongTextThatShouldBeScrollableHorizontally</p>
<p>RightColumnWithLongTextThatShouldBeScrollableHorizontally</p>
<p>RightColumnWithLongTextThatShouldBeScrollableHorizontally</p>
<p>RightColumnWithLongTextThatShouldBeScrollableHorizontally</p>
<p>RightColumnWithLongTextThatShouldBeScrollableHorizontally</p>
<p>RightColumnWithLongTextThatShouldBeScrollableHorizontally</p>
<p>RightColumnWithLongTextThatShouldBeScrollableHorizontally</p>
<p>RightColumnWithLongTextThatShouldBeScrollableHorizontally</p>
<p>RightColumnWithLongTextThatShouldBeScrollableHorizontally</p>
<p>RightColumnWithLongTextThatShouldBeScrollableHorizontally</p>
<p>RightColumnWithLongTextThatShouldBeScrollableHorizontally</p>
<p>RightColumnWithLongTextThatShouldBeScrollableHorizontally</p>
<p>RightColumnWithLongTextThatShouldBeScrollableHorizontally</p>
<p>RightColumnWithLongTextThatShouldBeScrollableHorizontally</p>
<p>RightColumnWithLongTextThatShouldBeScrollableHorizontally</p>
<p>RightColumnWithLongTextThatShouldBeScrollableHorizontally</p>
</div>
</div>
</div>