Table td auto width css

PHOTO EMBED

Thu Feb 23 2023 05:02:19 GMT+0000 (Coordinated Universal Time)

Saved by @codespare

td.last {
    width: 1px;
    white-space: nowrap;
}

Flexible, Class-Based Solution

And a more flexible solution is creating a .fitwidth class and applying that to any columns you want to ensure their contents are fit on one line:

td.fitwidth {
    width: 1px;
    white-space: nowrap;
}

And then in your HTML:

<tr>
    <td class="fitwidth">ID</td>
    <td>Description</td>
    <td class="fitwidth">Status</td>
    <td>Notes</td>
</tr>
content_copyCOPY

https://stackoverflow.com/questions/4757844/css-table-column-autowidth