CSS- table 序列号自动排序

HTML:

<table>
<thead>
    <tr>
    <th>序号</th>
    </tr>
</thead>
<tbody>
    <tr>
       <td class="SortCLASS"></td>
    </tr>
</tbody>
</table>

CSS:

tbody {
   counter-reset:sectioncounter;
}                      

.SortCLASS:before {
   content:counter(sectioncounter); 
   counter-increment:sectioncounter;

}

猜你喜欢

转载自blog.csdn.net/lm1022/article/details/79574088