Hello everyone, I'm encountering a minor issue with the table on my webshop created using Shopify. The problem arises when writing HTML code for the table, where it fails to fill out the entire site's space. While adding padding helps in the mobile version to prevent shrinking, adjusting the width to 100% didn't provide the desired outcome.
I experimented with flex grow 1, but unfortunately, that didn't resolve the issue either. Here is what it looks like without utilizing flexbox:
View desktop sample View mobile sample
And here is how it appears with flexbox:
View mobile flexibility View desktop flexibility
I am seeking an alternate method to ensure the table object occupies the full width while maintaining a minimum width requirement to avoid display issues on mobile devices. Is there a way to expand the table dynamically based on available space without compromising its appearance?
Below is the code snippet of the table:
<style type="text/css">
<!-- table.sizingchart {
display: flex;
text-align: center;
border-collapse: collapse;
white-space: nowrap;
overflow-x: auto;
}
table.sizingchart td,
table.sizingchart tr {
padding: 5px 15px;
flex-grow: 1;
}
table.sizingchart tr:nth-child(even) {
background: #EEEEEE;
}
-->
</style>
<table class="sizingchart">
<tbody>
...
// Table content goes here
...
</tbody>
</table>
Your guidance and suggestions are highly appreciated. Thank you in advance!
Warm regards,
Noah