separate a table cell into two equal parts with different background via css - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Cell

Description

separate a table cell into two equal parts with different background via css

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">
table {<!--  w w  w. ja va  2 s.c  om-->
   border:none;
   border-collapse:collapse;
   padding:0;
   margin:0;
}

tr {
   border:2px solid Chartreuse;
   padding:0;
   margin:0;
}

td {
   text-align:center;
   border:2px solid yellow;
   padding:0;
   margin:0;
   height:201px;
   width:201px;
}

th {
   height:201px;
   width:201px;
   border:2px solid blue;
   padding:0;
   margin:0;
}
</style> 
 </head> 
 <body> 
  <table> 
   <tbody> 
    <tr> 
     <th>L</th> 
     <th>L</th> 
    </tr> 
    <tr> 
    </tr> 
    <tr> 
     <td> 
      <table> 
       <tbody> 
        <tr> 
         <td style="background-color:orange;">L</td> 
         <td style="background-color:blue;">L</td> 
        </tr> 
       </tbody> 
      </table> </td> 
     <td>L</td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials