We help IT Professionals succeed at work.

Resize image based on the TD width

BLN2004
BLN2004 asked
on
Medium Priority
830 Views
Last Modified: 2012-06-27
I want to resize an image based on the TD width.Could you please help me out doing this
Comment
Watch Question

Commented:
sure,

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



  <td id='td1'>
  <img id='img1' src='/images/whatever.gif'>
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Commented:

 http:Q_20937172.html#10713270


script tags were a tad backwards...  ;-)

Commented:
no points needed for me here - was just pointing out an error in the code.  thanks anyway.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.