SiberianGuy
SiberianGuy

Reputation: 25302

Css table column width "as is"

Is there any way to specify table column width "as is". In other words, I want a column to have exact width its content takes to display.

Upvotes: 1

Views: 316

Answers (1)

Matthias Robbers
Matthias Robbers

Reputation: 15728

That should be the default case.

<!-- "table-layout" is "auto" by default as well, just to force it -->
<table border="1" style="table-layout:auto;">
    <tr>
        <td>Column 1</td>
        <td>Column 2</td>
    </tr>
</table>

This is how it looks like

Upvotes: 2

Related Questions