【发布时间】:2017-05-06 16:41:24
【问题描述】:
我有一个表格,省略号应该应用于第一个单元格(第一个单元格应该填充剩余空间),但是表格超出了父 div。我怎样才能让它发挥作用?
.wrapper {
width:200px;
background: wheat;
}
.el-cell {
width:99%;
display: block;
}
.table {
width: 100%;
}
.no-wrap {
white-space: nowrap;
}
.el {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
<div class="wrapper">
<table class="table">
<tr>
<td class="el-cell">
<div class="el">
<span>first cell should ellipsis aaaaaaa bbbb ccccccc</span>
</div>
</td>
<td>
<span class="no-wrap">2nd cell</span>
</td>
</tr>
</table>
</div>
【问题讨论】: