What is Nostr?
Adrian Roselli /
npub10ee…6keq
2024-12-18 15:47:44

Adrian Roselli on Nostr: Dusted this off for a use case where adding table row numbers server-side is not an ...

Dusted this off for a use case where adding table row numbers server-side is not an option and JS is overkill:
https://codepen.io/aardrian/pen/qEWrrOZ?editors=0100

If there is an empty cell starting a row, which is not a row header, then it inserts a counter (which starts at 0 so the row header gets excluded from the count).

```
table {
counter-reset: rowNum -1;
}

tr {
counter-increment: rowNum;
}

tr td:first-child:empty::before {
content: counter(rowNum);
}
```

#css
Author Public Key
npub10ee2ncgkjq5epjclj9e7f0tardj6smsyyrxe06p02sxjs22pxcyse46keq