I've a long text inside a span element and I want to truncate it using ellipsis. The span element is inside a div element which is inside a table cell.
How can I truncate the long text at the size of the cell.
Here the HTML code snippet:
<table>
<tr>
<td>
<div>
<span>
this is a long sentence to test the text overflow
</span>
</div>
</td>
</tr>
And the CSS code:
table {
width: 50px;
table-layout: fixed;
}
td {
border: 1px solid red;
}
span {
white-space: nowrap;
text-overflow: ellipsis;
}
Here my case in JSFiddle: http://jsfiddle.net/Fedy2/wG3CF/