Style a table within shade - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table

Description

Style a table within shade

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <style>
table {<!--from  w w w  .  jav a  2  s. co  m-->
   border-collapse:collapse;
   width:100%;
}

th, td {
   text-align:left;
   padding:9px;
}

tr:nth-child(even) {
   background-color:Chartreuse;
}

th {
   background-color:yellow;
   color:blue;
}
</style> 
 </head> 
 <body> 
  <h2>Lorem ipsum dolor si</h2> 
  <table> 
   <tbody> 
    <tr> 
     <th>Lorem ips</th> 
     <th>Lorem ip</th> 
     <th>Lorem i</th> 
    </tr> 
    <tr> 
     <td>Lorem</td> 
     <td>Lorem i</td> 
     <td>Lore</td> 
    </tr> 
    <tr> 
     <td>Lore</td> 
     <td>Lorem i</td> 
     <td>Lore</td> 
    </tr> 
    <tr> 
     <td>Lor</td> 
     <td>Lorem i</td> 
     <td>Lore</td> 
    </tr> 
    <tr> 
     <td>Lorem ips</td> 
     <td>Lorem</td> 
     <td>Lore</td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials