Thanks for the link. It was most helpful in getting what I wanted to achieve.
I finally had some time to test it out.
First, I limited the change to Sortable Tables using this nifty macro
{{sortable_tables filterable="yes"/}}
Based on what I read, here is the minimal CSS I added to the wiki theme customization under Administer Wiki, Look & Feel, Themes, Color Theme, Customize, Advanced
table.sortable tr.odd, table.sortable tr.even {
counter-increment: rowNumber;
}
table.sortable tr:not(:first-child) td:first-child::before {
content: counter(rowNumber) ". ";
}
table.sortable td:first-child {
text-align:center; /*optional*/
white-space: nowrap; /*optional - same as using <td nowrap>*/
}
The css adds the row number to the first TD column in the sortable table. The counter is only incremented for the even and odd table rows which is a style automatically added to the sortable table rows. It avoids numbering the filter row and the first header row.
If I don’t like it adding a number to the first column of data, then I can always add in a dummy column before the first column and give it a header of “#”.
The nice thing about this is it only numbers the rows that are present - so if I filter the rows, it only numbers the appearing rows.
That works for me.
[edit: fixed a couple of css mistakes]