这是否有可能呢?
我有一个填充其容器的表格(宽度为100%),其中两列(第一列和第三列)具有最小宽度,但中间一列没有。
当我缩小窗口时,我希望第一列和第三列保持最小宽度,而中间列必须完全折叠(当窗口太窄时,只显示第一列和第三列)。
谢谢。
以下是我拥有的简化代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>My first styled page</title>
<style type="text/css">
.overflow{
text-overflow: ellipsis;
word-break: break-all;
word-wrap: break-word;
}
.table{
width: 100%;
border-collapse: collapse;
border-spacing: 0;
}
.first{
min-width: 20px;
}
</style>
</head>
<body>
<table class="table">
<tr>
<td class="first"><div class="overflow">oneoneoneone</div></td>
<td class="second"><div class="overflow">twotwotwotwo</div></td>
<td class="first"><div class="overflow">threethreethree</div></td>
</tr>
</table>
</body>
</html>
td:nth-child(2), th:nth-child(2) {display:none;}
。 - SubjectCurio