CSS and form width problems

When I use the <form> tag and give it a background color, by default,
the form's width is 100%.

I would like it to behave like a table and have it constrict to fit the
content inside of it.

Is this possible with CSS?

Or do I have to resort to something ugly like putting a table around
the form?