I have the following table, with different widths of contents in each cell. I want the long next to nowrap and overflow.
I tried what it´s mentioned here: Why does overflow:hidden not work in a <td>?
But the result is all the cells get the same width, and I need the cells to adjust to the inner content, so there is not so much waisted white space in cells with short content (such as the checkbox one).
I can´t apply divs instead, and I can´t apply specific widths to each column since is a dynamic table so number of columns and it content may change.
¿Any clue?
Here´s the code. See the example at JSfiddle
<html>
<head>
<style>
table {
width: 100%;
}
table td {
border: 1px solid #ccc;
max-width: 1px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style>
</head>
<body>
<table>
<tr>
<td>
<input type="checkbox" />
</td>
<td>
ID001
</td>
<td>
Long-text-I-want-to-overflow-without-making-the-other-columns-wider-Long-text-I-want-to-overflow-without-making-the-other-columns-wider-Long-text-I-want-to-overflow-without-making-the-other-columns-wider-Long-text-I-want-to-overflow-without-making-the-other-columns-wider-
</td>
</tr>
</table>
</body>
</html>