
CSS table 增加序号
CSS table 增加序号
菜鸟教程
CSS counter-reset 属性 | 菜鸟教程www.runoob/cssref/pr-gen-counter-reset.html
属性定义及使用说明counter-reset属性创建或重置一个或多个计数器。
counter-reset属性通常是和counter-increment属性,content属性一起使用。
| none |
| no |
| CSS2 |
| object.style.counterReset="subsection" |
浏览器支持
所有主流浏览器都支持counter-reset属性。
注意: IE8只有指定!DOCTYPE才支持counter-reset属性。
属性值
| none | 默认。不能对选择器的计数器进行重置 |
| id number | id 定义重置计数器的选择器、id 或 class。 number 可设置此选择器出现次数的计数器的值。可以是正数、零或负数。 |
| inherit | 规定应该从父元素继承 counter-reset 属性的值 |
<tr> <td class="num"></td> </tr> tbody { counter-reset:sectioncounter; } .num:before { content:counter(sectioncounter); counter-increment:sectioncounter; }
👁️ 阅读量:0
© 版权声明:本文《CSS table 增加序号》内容均为本站精心整理或网友自愿分享,如需转载请注明原文出处:https://www.zastudy.cn/wen/1686969619a411306.html。