Adjust table column width to content size

Rui Carneiro picture Rui Carneiro · Mar 29, 2010 · Viewed 119.9k times · Source

Form (with firebug highlight hover the td):

example

Label column CSS:

width: auto;
padding: 0;
margin: 0;

The problem:

Why my left columns have that invisible "padding-right"? It's not possible to shrink columns to fit their content?

--EDIT--

The problem was the table itself. I defined table with "width: 100%". Removed that and the problem is gone.

Answer

Rui Carneiro picture Rui Carneiro · Mar 29, 2010

The problem was the table width. I had used width: 100% for the table. The table columns are adjusted automatically after removing the width tag.