HTML: How to set the width of a picture to be as wide as the size of a <td> ?

wishbasnet

New member
Hello,

In a HTML page, I set the width of an image like "100%" within <TD> <T/D> tags so that the picture would as wide as the width of the particular cell. But in some browser, like IE 7, due to that the picture appeared to be larger than the screen, with the need of scrolling. If any one could help me on the better way of coding this, I would really appreciate.

My coding was like this:

CSS:

table {
margin-left:15%;
margin-right:15%;
padding : 1px;
background-color : #a5d8f6;
border-color : #a5d8f6;
width:70%;
border-spacing :1px;
}

IN HTML PAGE:

<table><!-- FOR LOGO -->
<tr>
<td>
<img src="image/logo.jpg" height="150px" width="100%" alt="Logo Picture" />
</td>
</tr>
</table>
 
Back
Top