Below is the CSS and HTML code that I am working with:
#container {
display: table;
margin: 0 auto;
}
.table-container {
width: 100%;
overflow-x: auto;
_overflow: auto;
}
<div id='container'>
<div class='table-container'>
<table>
<tr>
<th>Example</th>
</tr>
<tr>
<td>blablablablablablablablablablablablablablablablablablablablablablablablabla</td>
</tr>
</table>
</div>
</div>
I am facing an issue where the overflow-x: auto
property is not functioning due to the presence of display: table
in the main container. It is crucial for me to retain the display: table
property as I require the width of the container div to match the content within it. Is there a way to maintain the functionality of overflow-y while still using display: table in the main container?