Is there a way to add a Horizontal scrollbar to an HTML table? I actually need it to be scrollable both vertically and horizontally depending on how the table grows but I can't get either scrollbar to appear.
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
- Adding a timeout to a render function in ReactJS
I had good success with the solution proposed by @Serge Stroobandt, but I encountered the problem @Shevy had with the cells then not filling the full width of the table. I was able to fix this by adding some styles to the
tbody
.This worked for me in Firefox, Chrome, and Safari on Mac.
I was running into the same issue. I discovered the following solution, which has only been tested in Chrome v31:
The 'more than 100% width' on the table really made it work for me.
I figured out this answer based on previous solution and it's comment and added some adjustments of my own. This works for me on the responsive table.
This is an improvement of Serge Stroobandt's answer and works perfectly. It solves the issue of the table not filling the whole page width if it has less columns.
Did you try CSS
overflow
property?UPDATE
As other users are pointing out, this is not enough to add the scrollbars.
So please, see and upvote comments and answers below.