我有这样的桌子:
------------------------------------------------
| product-name | icon | text |
------------------------------------------------
| product-info | icon | text |
------------------------------------------------
我希望我的单元格根据上一个单元格内容灵活:
------------------------------------------------
| product-name | ic | smt |
------------------------------------------------
| product-info | ic | smt |
------------------------------------------------
-------------------------------------------------
| product-name | icon | big-text |
-------------------------------------------------
| product-info, bla bla bla...| icon | text |
-------------------------------------------------
我试过这个CSS:
table {
table-layout: fixed;
font-size: 12px;
width: 100%;
}
table td:nth-child(1) {
max-width: 70%;
}
table td:nth-child(2) {
width: 10%;
}
table td:nth-child(3) {
max-width: 20%;
}
我放
table-layout:fixed
但是我不能让最大宽度工作。我不知道如何判断最后一个单元格是决定其他单元格大小的单元格。
这个
product-info
内容可以很大,我应用了一个省略号,它变得太大了。