I try to create an HTML table with three columns and would like to set the width of two of the columns (in this case, the first and the third) to "auto" (the width that fits their content). I'd like the third column (the middle one) to take the rest of the space.
This works great if the content of the middle column is narrower than the remaining width of the middle column, but if the content takes more width than the column than I get a table overflow.
Is there a way to achieve this even with long texts in the middle column? (Desired behavior: "cut" the text of the middle column if needed).
<div style="background-color:orange; width:200px; padding: 5px">
<table style="background-color: pink">
<tr>
<td style="background-color:red">
123456
</td>
<td style="background-color:yellow; width:100%">
1234567890123
</td>
<td style="background-color:green">
123456
</td>
</tr>
</table>
</div>
td, not the table