I have an image gallery set up where the pictures are partially shown in each cell (as a preview) as the cell background. When the mouse moves over the cell, the cell expands to the size of the full picture. I was wondering if there was a way to automatically resize the cell to the image dimensions instead of manually imputing the full dimensions as the height and width of the cell on mouse over. I've already tried replacing height='200px' to height=auto or height=100% but neither seem to work. 

Here's an example of the code:

```
<table cellpadding="0" border="0">  
        <tr>
            <td width="275px" height="200px" onmouseover="width='400px'; height='268px'" style="background-repeat:no-repeat" 
            class="fx" onmouseleave="width='275px'; height='200px'" align="center" background="images/kitchen/1.jpg"></td>

            <td width="275px" height="200px" onmouseover="width='400px'; height='268px'" style="background-repeat:no-repeat" 
            class="fx" onmouseleave="width='275px'; height='200px'" align="center" background="images/kitchen/2.jpg"></td>

            <td width="275px" height="200px" onmouseover="width='400px'; height='268px'" style="background-repeat:no-repeat" 
            class="fx" onmouseleave="width='275px'; height='200px'" align="center" background="images/kitchen/3.jpg"></td>
       </tr>
</table>

```