试图修复CSS表问题 [英] Trying to fix CSS tables problem

查看:69
本文介绍了试图修复CSS表问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试将现有桌面从一个网站导入shopify主题,但Shopify正在打击我。无论如何我不是CSS专家。无论表中的html是什么,Shopify代码似乎都坚持要使所有列宽相等。所以换句话说......如果你有4列,其中3列只有4个字符,第4列有50个...它会在3列中留下大量的空间,只有4个字符,并包裹第四个文字。笨。这是shopify中主题的所有CSS表格代码...



我尝试过:



 table {border-collapse:collapse; border-spacing:0;最小宽度:50%; } 

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

th {font-weight:$ baseFontBoldWeight; }

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

填充最初为2.我将其更改为6有助于。但代码仍然坚持要使所有列均匀宽度。我假设其中一个CSS标签告诉它这样做,因为没有html标签似乎覆盖它。有人知道吗?

解决方案

gutter / 2; }

th {font-weight:


baseFontBoldWeight; }

th,td {text-align:left;填充:

排水沟/ 6; border:1px solid


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?

解决方案

gutter/2; } th { font-weight:


baseFontBoldWeight; } th, td { text-align: left; padding:


gutter/6; border: 1px solid


这篇关于试图修复CSS表问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆