Click here to Skip to main content
15,887,175 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I've been trying to import existing tables from a site into a shopify theme, but Shopify is fighting me. I'm not a CSS expert by any means. No matter what the html is in the table, the Shopify code seems to insist on making all column widths equal. So in other words... If you have 4 columns, and three of them have just four characters, and the fourth has 50... It will leave a huge amount of space in the 3 columns with just 4 characters, and wrap the text in the fourth. Stupid. Here's all the CSS table code for the theme in shopify...

What I have tried:

table { border-collapse: collapse; border-spacing: 0; min-width: 50%; } 

table.full { width: 100%; margin-bottom: $gutter/2; } 

th { font-weight: $baseFontBoldWeight; } 

th, td { text-align: left; padding: $gutter/6; border: 1px solid $colorBorder; } 

The padding was originally 2. I changed it to 6 which helped. But the code still insists on making all the columns an even width. I assume one of these CSS tags is telling it to do that, since no html tags seem to override it. Anybody know?
Posted
Comments
Richard Deeming 23-Nov-18 8:02am    
Use the browser's developer tools to inspect the table element. Does it have table-layout: fixed set?

table-layout - CSS: Cascading Style Sheets | MDN[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900