Setting the width of a html table td - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Width

Description

Setting the width of a html table td

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 {<!-- www . j av  a2  s  .c om-->
   width:551px;
}

.a1 {
   width:61px;
   background-color:Chartreuse;
}

.a2 {
   width:91px;
   background-color:yellow;
}

.a3 {
   width:91px;
   background-color:blue;
}

.a4 {
   width:100px;
   background-color:pink;
}
</style> 
 </head> 
 <body> 
  <table> 
   <thead> 
    <tr> 
     <th class="a1">Lore</th> 
     <th class="a2">Lorem ipsu</th> 
     <th class="a3">Lorem ips</th> 
     <th class="a4">Lorem ip</th> 
    </tr> 
   </thead> 
   <tbody> 
    <tr> 
     <td class="a1">Lore</td> 
     <td class="a2">Lorem ipsu</td> 
     <td class="a3">Lorem ips</td> 
     <td class="a4">Lorem ip</td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials