Autonumber table rows (html, css)

spiros

  • Administrator
  • Hero Member
  • *****
    • Posts: 854546
    • Gender:Male
  • point d’amour
Autonumber table rows (html, css)
The result will be
1.
2.
...

Code: [Select]
table
{
    counter-reset: rowNumber;
}

table tr > td:first-child
{
    counter-increment: rowNumber;
}

table tr td:first-child::before
{
    content: counter(rowNumber)".";
    min-width: 1em;
    margin-right: 0.5em;
}
javascript - Auto-number table rows? - Stack Overflow
« Last Edit: 29 May, 2021, 16:38:40 by spiros »


 

Search Tools