Setting width of table cells with CSS - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Cell

Description

Setting width of table cells with CSS

Demo Code

ResultView the demo in separate window


<html>
 <head> 
  <style type="text/css">
table,th,td {
   border:solid 2px;
   border-collapse:collapse;
}

table {<!--from   w  w w. ja  va 2 s  .  c o m-->
   width:701px;
}

.label {
   width:100px;
}
</style> 
 </head> 
 <body> 
  <table> 
   <tbody> 
    <tr> 
     <th class="caption" colspan="2">Lorem i</th> 
    </tr> 
    <tr> 
     <td class="label"></td> 
     <td>Lorem ip</td> 
    </tr> 
    <tr> 
     <td class="label">Lorem</td> 
     <td>Lorem ip</td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials