I have a table with a dynamic drop down list.
The width of the drop-down list will change depending on its contents.
I would like the table column to be the same as the width of the dropdown.
If I set the width smaller than the size of the IE dropdown, it seems that the column is larger than the dropdown, while it wraps the column heading, it inserts spaces on either side of the drop-down list.
Is there a way in CSS to say that just making a column the same size as its contents?
Here is an example html table that includes my current fix (kludge)
<table id="mappingtable" width="100%" align="center" cellspacing="0" cellpadding="0" border="0">
<tr>
<th width="80px">FixedWidthColumn</th>
<th width="80%">ExpandingColumn</th>
<th width="122px"> </th>
<th>DynamicColumn</th>
</tr>
<tr>
<td align="center">1</td>
<td>Text</td>
<td align="center">Button</td>
<td align="center">DropDownList</td>
</tr>
</table>
The problem exists without any css
If I remove the width = "80%" from the expanding column, the dynamic column will have spaces
width: auto ,