Label each row of an HTML table numerically - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Row

Description

Label each row of an HTML table numerically

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">
body {<!--from  w ww.j  av a 2  s  .  co  m-->
   counter-reset:chapter;
}

tr:before {
   content:counter(chapter);
   counter-increment:chapter;
   padding-right:6px;
}
</style> 
 </head> 
 <body> 
  <table> 
   <tbody> 
    <tr> 
     <td>Lorem ips</td> 
    </tr> 
    <tr> 
     <td>Lorem ips</td> 
    </tr> 
    <tr> 
     <td>Lorem ipsum do</td> 
    </tr> 
    <tr> 
     <td>Lorem ipsum do</td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials