I have a table and want all columns to be the same width (irrespective of content), except for the last one, which is supposed to be 20px narrower than the first two.
td:nth-child(3) { width: calc(100% - 20px); }
breaks the layout unfortunately.
I am aware of similar questions (CSS calc not working for <td> width), but unfortunately, no working solution is given. Is this not possible with pure CS??
table {
width: 100%;
table-layout: fixed;
}
td { border: 1px solid red; }
td:nth-child(1) { width: 100%; }
td:nth-child(2) { width: 100%; }
td:nth-child(3) { width: calc(100% - 20px); }
<table>
<tr>
<td>l</td>
<td>lol</td>
<td>3</td>
</tr>
</table>