I had the thought gosh I wish this table’s rows were numbered when I was looking at the big table of Interop 2024 popular votes. I don’t know the that the <table> needed numbering, but when I wanted to know the “rank” of some of the items, I found myself wishing it did.
Fortunately, CSS has a quick answer:
table {
counter-reset: tr;
tbody tr {
counter-increment: tr;
:where(td, th):first-child::before {
content: "#" counter(tr) ": ";
}
}Code language: CSS (css)