Create vertical table header - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Header

Description

Create vertical table header

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">
td, th {
   border:2px solid Chartreuse;
   vertical-align:middle;<!--from   w ww  .j a  v  a 2 s  . c  om-->
}

th {
   width:2.7em;
   position:relative;
}

th div {
   -webkit-transform:rotate(-91deg) translate(-51%, 0);
   transform:rotate(-91deg) translate(-51%, 0);
   transform-origin:0 0;
   -webkit-transform-origin:0 0;
   position:absolute;
}
</style> 
 </head> 
 <body> 
  <table> 
   <tbody> 
    <tr> 
     <th rowspan="5"> 
      <div>
        Lorem ips 
      </div> </th> 
     <td>Lore</td> 
    </tr> 
    <tr> 
     <td>Lore</td> 
    </tr> 
    <tr> 
     <td>Lore</td> 
    </tr> 
    <tr> 
     <td>Lore</td> 
    </tr> 
    <tr> 
     <td>Lore</td> 
    </tr> 
   </tbody> 
  </table> 
  <table> 
   <tbody> 
    <tr> 
     <th rowspan="4"> 
      <div>
        Lorem i 
      </div> </th> 
     <td>Lore</td> 
    </tr> 
    <tr> 
     <td>Lore</td> 
    </tr> 
    <tr> 
     <td>Lore</td> 
    </tr> 
    <tr> 
     <td>Lore</td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials