Placing a canvas exactly inside a table cell - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Cell

Description

Placing a canvas exactly inside a table cell

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
.mainTable {<!--   w w w. j a  v a  2s  .  c o  m-->
   width:100%;
   height:1001px;
   border:2px solid Chartreuse;
}

td {
   border:2px groove yellow;
   padding:0;
   width:34%;
}

#animationCanvas_1 {
   background-color:blue;
}
</style> 
 </head> 
 <body> 
  <table class="mainTable"> 
   <tbody> 
    <tr id="headingTable"> 
     <th></th> 
     <th></th> 
     <th></th> 
    </tr> 
    <tr id="rowFirst"> 
     <!-- reflecting balls --> 
     <td> 
      <canvas id="animationCanvas_1"> 
      </canvas> </td> 
     <td></td> 
     <td></td> 
    </tr> 
    <tr id="rowSecond"> 
     <!-- growing circle with changing color --> 
     <td></td> 
     <td></td> 
     <td></td> 
    </tr> 
    <tr id="rowThird"> 
     <!-- animation with css only --> 
     <td></td> 
     <td></td> 
     <td></td> 
    </tr> 
    <tr id="rowFourth"> 
     <!-- random rectangle --> 
     <td></td> 
     <td></td> 
     <td></td> 
    </tr> 
    <tr id="rowFifth"> 
     <!-- rotating objects --> 
     <td></td> 
     <td></td> 
     <td></td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials