In the code, I'm trying to keep the table inside the div. The table has a width of 100% inside a 100px div.
The problem is the content stretches regardless. What is the best way to handle this?
#container {
width: 100px;
border: 1px solid green;
}
table {
width: 100%;
border: 1px solid blue;
}
table div {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: calc(100% - 10px);
}
<div id="container">
<table>
<tr>
<td>1</td>
<td><div>abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba</div>
</td>
</tr>
</table>
</div>