user123 user123 - 3 months ago 6
HTML Question

How can I set the width/height of td tag in which image is included?

I want to set the width and height of td tag , which have and tag inside. So , what I want to do is , no matter whatever the image size is , but it should be taken according to the width/height of td tag.

Example.

If image size is 200 * 100 and td tag's width and height is 100*50. then it should take 100 * 50 , according to the width and height of td tag.



<tr>
<td valign="top" align="center" id="animate" style="color: #FFFFFF;font-family: 'Montserrat', sans-serif; font-size:12px;font-weight:bold;line-height: 0px;letter-spacing:1px;text-align:center;text-transform:uppercase;" width="100" height="100">
<img src="http://www.hubilo.com/eventApp/ws/images/event/logo/thumb/2712_1455295221.png" width="70" height="70" >
</td>
</tr>





I can't use position property for the same.

Thank You

Answer

try this.

display:block;
width:100%;
height:auto;