Link to home
Start Free TrialLog in
Avatar of BLN2004
BLN2004

asked on

Resize image based on the TD width

I want to resize an image based on the TD width.Could you please help me out doing this
Avatar of dgelinas
dgelinas
Flag of United States of America image

sure,

</script>
function resizeImage() {
  document.getElementById('img1').width =  document.getElementById('td1').offsetWidth
}
<script>



  <td id='td1'>
  <img id='img1' src='/images/whatever.gif'>
ASKER CERTIFIED SOLUTION
Avatar of dgelinas
dgelinas
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

 http:Q_20937172.html#10713270


script tags were a tad backwards...  ;-)
no points needed for me here - was just pointing out an error in the code.  thanks anyway.