我有一個表使用省略號,但我堅持與衝突的爭論。這個場景是我有一個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