Does anyone have a way of auto numbering table rows in xwiki?
What I was looking for was to have one column of a table row the row number. And in the case of {{sortable_tables filterable=“yes”/}} tables, that the numbering would only number the visible rows that the filter selects.
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
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.