我有一个表使用省略号,但我坚持与冲突的争论。这个场景是我有一个tr标签和2个td的表。我需要第一个td是文本的宽度(border-collapse:collapse),但是,我需要表格的宽度为100%,所以在第二个td中我可以使用省略号。我还没有找到一种方法来将第一个td边界合并,并将第二个用作省略号。在表中使用省略号
http://jsfiddle.net/epywtvjf/2/
<table>
<tr>
<td>This is the first div.
</td>
<td>This is the second div. This is the second div.This is the second div. This is the second div. This is the second div.
</td>
</tr>
<tr>
<td>This is the first div.
</td>
<td>This is the second div. This is the second div.This is the second div. This is the second div. This is the second div.
</td>
</tr>
<tr>
<td>This is the first div.
</td>
<td>This is the second div. This is the second div.This is the second div. This is the second div. This is the second div.
</td>
</tr>
</table>
table{
table-layout: fixed;
width: 100%;
border-collapse: collapse;
}
table td{
white-space: nowrap;
border: none;
line-height:unset;
padding: 0px;
text-align: left;
}
所以,你要在第一列宽但它需要的,以适应其文本,然后第二列只得到推过,如果他们太宽将其内容ellipsed ? – cjl750
是的,这是正确的 – Keith