center an image in a table td - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Cell

Description

center an image in a table td

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
 </head> <!--   ww w.  j  a  va  2s . c o  m-->
 <body> 
  <table width="100%" border="1"> 
   <tbody> 
    <tr> 
     <td>&nbsp;</td> 
     <td align="center" valign="middle"> <img src="https://www.java2s.com/style/demo/InternetExplorer.png"> </td> 
     <td>&nbsp;</td> 
    </tr> 
    <tr> 
     <td>&nbsp;</td> 
     <td align="center" valign="middle"> <img src="https://www.java2s.com/style/demo/Google-Chrome.png"> </td> 
     <td>&nbsp;</td> 
    </tr> 
    <tr> 
     <td>&nbsp;</td> 
     <td align="center" valign="middle"> <img src="https://www.java2s.com/style/demo/Google-Chrome.png"> </td> 
     <td>&nbsp;</td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials