How do I shrink a centered table to fit its contents and still be centered?

How do I shrink a centered table to fit its contents and still be centered?

suppose I have a table centered using the (obsolete) center tags.
The contents of this table are radio-buttons that are added dynamically with Javascript.
My problem is that  these radio-buttons sometimes have several words of text associated with each choice, and sometimes only a few.  So if I have really big table with fixed width, it will look OK for long text, but not if the maximum text over all radios is only two or three words.  In the latter case, the radios will be on the far left side of the screen.  
I could just use styling to center the radios, but that looks very messy when the radios are different widths.
I tried using this:
$("#mytable").width(maxradiosize);  
but that does not seem to work.  The table does contain a DIV, and the DIV is what I use to append radios to.  But I'm setting the DIV width also with .width(maxradiosize).
Should this work?
Thanks