Two Images not coming side-by-side. What I am missing here? <html> <head> <script language="javascript"> function fn_large() { document.getElementById('myImage').style.height = '400px'; document.getElementById('myImage').style.width ="400px"; } function fn_normal() { document.getElementById('myImage').style.height = '130px'; document.getElementById('myImage').style.width ="170px"; } </script> </head> <body> <table border=1> <tr><td><image id="myImage" src="pic1.JPG" border=1 width="340px" height="260px" onMouseover="fn_large()" onMouseout="fn_normal()"></td></tr> <tr><td><image id="myImage" src="pic2.JPG" border=1 width="340px" height="260px" onMouseover="fn_large()" onMouseout="fn_normal()"></td></tr> </table> </body> </html>
Try this: <html> <head> <script language="javascript"> function fn_large(imgID) { document.getElementById(imgID).style.height = '400px'; document.getElementById(imgID).style.width ="400px"; } function fn_normal(imgID) { document.getElementById(imgID).style.height = '130px'; document.getElementById(imgID).style.width ="170px"; } </script> </head> <body> <table border=1> <tr><td><img id="myImage1" src="pic1.JPG" border=1 width="340px" height="260px" onMouseover="fn_large(this.id)" onMouseout="fn_normal(this.id)"></td><td><img id="myImage2" src="pic2.JPG" border=1 width="340px" height="260px" onMouseover="fn_large(this.id)" onMouseout="fn_normal(this.id)"></td></tr> </table> </body> </html> Code (markup):
Yeap! It's coming fine side-by-side now but I need to give some space (about 1/2 " or so) between the two pics.
Change content of body to this: <table border=1> <tr><td><img id="myImage1" src="pic1.JPG" border=1 width="340px" height="260px" onMouseover="fn_large(this.id)" onMouseout="fn_normal(this.id)"></td><td><img style="margin-left: 20px" id="myImage2" src="pic2.JPG" border=1 width="340px" height="260px" onMouseover="fn_large(this.id)" onMouseout="fn_normal(this.id)"></td></tr> </table> Code (markup): If you want to change the distance, change the number 20 in the code "margin-left: 20px".