Assigning a class to individual td elements in HTML - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Div

Description

Assigning a class to individual td elements in HTML

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 {<!--from w  w w .  j  a v  a 2s  .co m-->
   border-spacing:0px;
   border-collapse:collapse;
}

td, th {
   border:2px solid Chartreuse;
   padding:5px 9px;
}

.text-justify {
   text-align:justify
}

.text-left {
   text-align:left
}
</style> 
 </head> 
 <body> 
  <table> 
   <tbody> 
    <tr> 
     <th>title 1</th> 
     <th>title 2</th> 
     <th>title 3</th> 
    </tr> 
    <tr> 
     <td>text</td> 
     <td class="text-justify">more info 1</td> 
     <td class="text-left">$1000 </td> 
    </tr> 
    <tr> 
     <td>text</td> 
     <td class="text-justify">more info more 1</td> 
     <td class="text-left">$ 100</td> 
    </tr> 
    <tr> 
     <td>text</td> 
     <td class="text-justify">more info 1</td> 
     <td class="text-left">$ 100000</td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials